Syntax

JavaScript Log to Console Syntax

In JavaScript, log to console: prints a value to the browser or Node console — console.log(value)

Quick Answer

Syntax
console.log(value)
JavaScriptSyntax

Log to Console

Code example
console.log(value)

Prints a value to the browser or Node console.

Learn More

How to log to console in JavaScript

  1. Open your JavaScript file or editor.
  2. Copy the example, then replace its sample names and values for your code.

JavaScript Log to Console Syntax

Use console.log(value).

Related Syntax References

Frequently asked questions

What is the JavaScript syntax for log to console?

Use this pattern: console.log(value)

Can I copy this JavaScript code example?

Yes. Use Copy code and adapt the example to your program.

Is this JavaScript syntax different on Mac or Windows?

No. The language syntax is the same across operating systems.

Official source · How we verify