| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/en-US/docs/Web/API/console/log_static | [Back] [Original] |
Get to know MDN better
This feature is well established and works across many devices and browser versions. Its been available across browsers since July 2015.
Note: This feature is available in Web Workers.
The console.log() static method outputs a message to the console.
console.log(val1)
console.log(val1, /* , */ valN)
console.log(msg)
console.log(msg, subst1, /* , */ substN)
val1 valNA list of JavaScript values to output. A representation of each of these values is output to the console in the order given with some type of separation between each of them. There is a special case if val1 is a string, which is described subsequently.
msgA JavaScript string containing zero or more substitution strings, which are replaced with subst1 through substN in consecutive order up to the number of substitution strings. See Using string substitutions for a description of how substitutions work.
subst1 substNJavaScript values with which to replace substitution strings within msg. If there are more substitution values than there are substitution strings, the extra values are themselves written to the console after the detailed assertion message in the same manner as when there's no format string.
See Outputting text to the console in the documentation of console for further details.
None (undefined).
| Specification |
|---|
| Console # log |
console.log()console.log()console.log()This page was last modified on Jul 4, 2025 by MDN contributors.
Your blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |