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.
- Reverse the
isCompleteparameter using!. - Apply the
!on thestatusCodeto test its truthiness switch. - Bring both switched values into an array:
[flippedComplete, flippedCode]and return it.
01EXAMPLE 1
Input
isComplete = false, statusCode = 0Output
[true, true]Explanation: Falsy 0 turns to true and false turns true.
Constraints
- Use the ! operator appropriately.
- Return an array [boolean, boolean] format.
FundamentalsLogicOperators
JavaScriptSystem handles I/O — write your function only
Loading...
5 Hidden
Input Arguments
isCompletefalse
statusCode0
Expected Output
[true,true]
Click RUN to test your solution