The Logic Inverter
Easy+15 XP
Mission Briefing
The logic gates to the inner sanctum are inverted. A true key opens a false door. You must build an inverter circuit to safely pass through.
The Concept: Boolean Inversion
The ! (Logical NOT) operator is a flipper. It takes a boolean value (true or false) and immediately reverses it. If it was true, it becomes false, and vice versa.
The Objective
Your function receives a boolean parameter named state.
- Invert the boolean value of
state. - Return the exact opposite of the original state.
01EXAMPLE 1
Input
state = trueOutput
falseConstraints
- Use the ! operator.
FundamentalsBooleans
JavaScriptSystem handles I/O — write your function only
Loading...
3 Hidden
Input Arguments
statetrue
Expected Output
false
Click RUN to test your solution