Both Conditions
EasyAcc. 94.2%
+30 XP 10
Entry Approvals
Taking important steps like bank withdrawal depends on meeting all conditions. The Logical AND (&&) only approves verification if both left and right statements return a true value.
The Assignment
Your inputs are age and a card check hasID.
- Check if the
ageis strictly greater than 21. - Check if
hasIDis actively true. - Use the
&&symbol to merge these rules smoothly, and return the combined boolean.
01EXAMPLE 1
Input
age = 25, hasID = trueOutput
trueExplanation: Both age > 21 and hasID are true.
Constraints
- Use the && operator.
- Return true only if both logic blocks match.
FundamentalsLogicOperators
JavaScriptSystem handles I/O — write your function only
Loading...
5 Hidden
Input Arguments
age25
hasIDtrue
Expected Output
true
Click RUN to test your solution