The Continental Guard
EasyAcc. 94.8%
+20 XP 8
Simplified Gatekeeping
Sometimes, multiple keys can open the same door. Instead of writing two separate if statements, we use the Logical OR (||) to check if either one of the conditions is true.
The Assignment
Your function receives a parameter named country.
- Build a border check using
if-else:- If the
countryis "USA" OR "Canada", print: "North American" - Otherwise, print: "Other region"
- If the
01EXAMPLE 1
Input
country = "Canada"Output
Logs: "North American"Explanation: Canada is one of the valid states.
02EXAMPLE 2
Input
country = "France"Output
Logs: "Other region"Explanation: France matches neither condition.
Constraints
- Use the || operator inside your if condition.
- Log messages must match exactly.
Control FlowConditionalsLogic
JavaScriptSystem handles I/O — write your function only
Loading...
4 Hidden
Input Arguments
country"Canada"
Expected Output
North American
Click RUN to test your solution