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.

  1. Flip the isComplete value using !.
  2. Flip the statusCode value using !.
  3. Return both result in an array: [flippedComplete, flippedCode].

01EXAMPLE 1

InputisComplete = false, statusCode = 0
Output[true, true]

Explanation: !false is true, !0 is true.

Constraints

  • Use the ! operator.
  • Return an array [boolean, boolean].
FundamentalsLogicOperators
JavaScript
Loading...
9 Hidden

Input Arguments

isCompletefalse
statusCode0

Expected Output

[true,true]

Click RUN to test your solution