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".
- Use a single
console.log()with a comma to print the literal text "Role:" followed by theuserRolevariable. - The system verifies the console output, so do not return a value.
01EXAMPLE 1
Input
userRole = "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
JavaScriptSystem handles I/O — write your function only
Loading...
9 Hidden
Input Arguments
userRole"Admin"
Expected Output
Role: Admin
Click RUN to test your solution