Print With Comma
EasyAcc. 94.8%
+15 XP 5
Printing Logs
When checking the output, we often need to print text and variables together. Using a comma inside console.log automatically adds a single space between the parts, keeping them clean.
The Assignment
Your function receives a userRole string.
- Use a single
console.log()separated by a comma. - Print the text "Role:" followed by the
userRolevariable. - Because the system checks the printed output, do not return anything.
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...
5 Hidden
Input Arguments
userRole"Admin"
Expected Output
Role: Admin
Click RUN to test your solution