The Ghost Signal

MediumAcc. 90.2%
+20 XP 8

The Whispering Logic

In professional code, you don't always need a heavy if statement. You can use the Short-Circuit AND (&&) to execute a command only if the condition is true. If the first part is false, JavaScript ignores the second part entirely.

The Assignment

Your function receives a boolean parameter named debugMode.

  1. Write a single line of code using &&:
    • If debugMode is true, use console.log() to print: "Debugging log activated."
    • If it is false, nothing should happen.

01EXAMPLE 1

InputdebugMode = true
OutputLogs: "Debugging log activated."

Explanation: Short-circuit allows the log to run.

02EXAMPLE 2

InputdebugMode = false
OutputNo output

Explanation: Condition is false, so the log is skipped.

Constraints

  • Use the && operator for shorthand logic.
  • Do not use a traditional if statement.
  • Log message must match exactly.
Control FlowConditionalsLogic
JavaScript
Loading...
4 Hidden

Input Arguments

debugModetrue

Expected Output

Debugging log activated.

Click RUN to test your solution