Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / JavaScript

console.log — console output

console.log prints values to the debugging console. It accepts multiple arguments and formatting, and returns undefined.

Version: ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support

Syntax

console.log(...data)

console.log(...data) sends values to the console at the log level. It is an API described by the Console Standard, not a function defined by ECMAScript. It accepts zero or more arguments; calling it without arguments prints nothing.

A string first argument can contain specifiers replaced by subsequent arguments: %s means a string and %d an integer. Message and object presentation depends on the implementation.

The method returns undefined, not the printed text. An interactive console may display that return value separately. The example should print Total: 5.

Examples

console.log("Total: %d", 2 + 3);

Result

Total: 5

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources