Console.log
The console.log() function is your best friend when learning JavaScript. It outputs values to the console, helping you see what your code is doing.
Basic Usage
Loading JavaScript Playground...
Printing Multiple Values
You can print multiple values separated by commas:
Loading JavaScript Playground...
Console Methods
JavaScript has several console methods:
Loading JavaScript Playground...
Exercise: Multiple Outputs
Print your name, age, and a greeting on separate lines:
Loading JavaScript Exercise...
Exercise: Math Output
Use console.log to display a math calculation:
Loading JavaScript Exercise...
Up next · Lesson 3 of 37
Comments
1 min read
2 of 37 lessons done

Ask Byte about this lesson
A private chat about this lesson. Byte has read the whole lesson, answers in seconds, and shows the section each answer comes from. Ask follow-ups in any language.
Questions & Answers
Public questions about this lesson. The AI Tutor answers right away in your language, the FreeAcademy team checks answers, and every learner can read them.

