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.

  1. Use a single console.log() separated by a comma.
  2. Print the text "Role:" followed by the userRole variable.
  3. Because the system checks the printed output, do not return anything.

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...
5 Hidden

Input Arguments

userRole"Admin"

Expected Output

Role: Admin

Click RUN to test your solution