Reverse Mode

EasyAcc. 95.1%
+25 XP 8

Switching States

Buttons like dark mode toggles or hiding sidebars just invert current situations to the opposite choice. Placing a ! reverses any boolean variable fast. Also, evaluating fake values like zero becomes correctly evaluated to true!

The Assignment

Your duty is flipping truth signals.

  1. Reverse the isComplete parameter using !.
  2. Apply the ! on the statusCode to test its truthiness switch.
  3. Bring both switched values into an array: [flippedComplete, flippedCode] and return it.

01EXAMPLE 1

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

Explanation: Falsy 0 turns to true and false turns true.

Constraints

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

Input Arguments

isCompletefalse
statusCode0

Expected Output

[true,true]

Click RUN to test your solution