The Comma Trick

EasyAcc. 94.8%
+15 XP 5

Ancient Logs

The starship's legacy terminal automatically adds a single space between logged arguments. To avoid double-spacing errors, you must use the "comma syntax" rather than merging strings with +.

console.log("A", "B") results in "A B".

  1. Use a single console.log() with a comma to print the literal text "Role:" followed by the userRole variable.
  2. The system verifies the console output, so do not return a value.

01EXAMPLE 1

InputuserRole = "Admin"
Output"Role: Admin"

Explanation: Logs "Role: Admin" with the comma adding a space automatically.

Constraints

  • Use console.log with a comma separator.
  • Do not return any value.
FundamentalsConsoleSyntax
JavaScript
Loading...
9 Hidden

Input Arguments

userRole"Admin"

Expected Output

Role: Admin

Click RUN to test your solution