Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: update console.error example to API doc #34964

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion doc/api/console.md
Expand Up @@ -30,7 +30,13 @@ console.log('hello world');
console.log('hello %s', 'world');
// Prints: hello world, to stdout
console.error(new Error('Whoops, something bad happened'));
// Prints: [Error: Whoops, something bad happened], to stderr
// Prints: custom message and stack trace to stderr
iyabong marked this conversation as resolved.
Show resolved Hide resolved
// Error: Whoops, something bad happened
// at Server.<anonymous> (D:\node-training\console_error_ex.js:13:15)
// at Object.onceWrapper (events.js:420:28)
// at Server.emit (events.js:314:20)
// at emitListeningNT (net.js:1350:10)
// at processTicksAndRejections (internal/process/task_queues.js:79:21)
iyabong marked this conversation as resolved.
Show resolved Hide resolved

const name = 'Will Robinson';
console.warn(`Danger ${name}! Danger!`);
Expand Down