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

console: change doc to follow major browser console doc #3584

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions doc/api/console.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ In daily use, the blocking/non-blocking dichotomy is not something you
should worry about unless you log huge amounts of data.


### console.log([data][, ...])
### console.log(object [, object, ...])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first argument is optional too. You can call console.log() to print a blank line.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested this before, Node and Firefox print an empty line, Chrome does not. Maybe it should be brought up with the spec authors?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meh, what actually matters here is what Node does.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be console.log([object, ...]), I think.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or console.log([object [, ...]]) ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


Prints to stdout with newline. This function can take multiple arguments in a
`printf()`-like way. Example:
Expand All @@ -44,15 +44,15 @@ Prints to stdout with newline. This function can take multiple arguments in a
If formatting elements are not found in the first string then `util.inspect`
is used on each argument. See [util.format()][] for more information.

### console.info([data][, ...])
### console.info(object [, object, ...])

Same as `console.log`.

### console.error([data][, ...])
### console.error(object [, object, ...])

Same as `console.log` but prints to stderr.

### console.warn([data][, ...])
### console.warn(object [, object, ...])

Same as `console.error`.

Expand Down