{ "source": "doc/api/stdio.markdown", "globals": [ { "textRaw": "console", "name": "console", "stability": 4, "stabilityText": "API Frozen", "type": "global", "desc": "
For printing to stdout and stderr. Similar to the console object functions\nprovided by most web browsers, here the output is sent to stdout or stderr.\n\n
\n", "methods": [ { "textRaw": "console.log([data], [...])", "type": "method", "name": "log", "desc": "Prints to stdout with newline. This function can take multiple arguments in a\nprintf()
-like way. Example:\n\n
console.log('count: %d', count);
\nIf formatting elements are not found in the first string then util.inspect
\nis used on each argument. See [util.format()][] for more information.\n\n
Same as console.log
.\n\n
Same as console.log
but prints to stderr.\n\n
Same as console.error
.\n\n
Uses util.inspect
on obj
and prints resulting string to stdout.\n\n
Mark a time.\n\n
\n", "signatures": [ { "params": [ { "name": "label" } ] } ] }, { "textRaw": "console.timeEnd(label)", "type": "method", "name": "timeEnd", "desc": "Finish timer, record output. Example:\n\n
\nconsole.time('100-elements');\nfor (var i = 0; i < 100; i++) {\n ;\n}\nconsole.timeEnd('100-elements');
\n",
"signatures": [
{
"params": [
{
"name": "label"
}
]
}
]
},
{
"textRaw": "console.trace(label)",
"type": "method",
"name": "trace",
"desc": "Print a stack trace to stderr of the current position.\n\n
\n", "signatures": [ { "params": [ { "name": "label" } ] } ] }, { "textRaw": "console.assert(expression, [message])", "type": "method", "name": "assert", "desc": "Same as [assert.ok()][] where if the expression
evaluates as false
throw an\nAssertionError with message
.\n\n