The NOT Operator
EasyAcc. 95.1%
+25 XP 8
State Inversion
The Logical NOT (!) operator is used to toggle boolean states. It can also be used to quickly determine the "truthiness" of a value.
- Flip the
isCompletevalue using!. - Flip the
statusCodevalue using!. - Return both result in an array:
[flippedComplete, flippedCode].
01EXAMPLE 1
Input
isComplete = false, statusCode = 0Output
[true, true]Explanation: !false is true, !0 is true.
Constraints
- Use the ! operator.
- Return an array [boolean, boolean].
FundamentalsLogicOperators
JavaScriptSystem handles I/O — write your function only
Loading...
9 Hidden
Input Arguments
isCompletefalse
statusCode0
Expected Output
[true,true]
Click RUN to test your solution