Browse Source

doc: fix format docs discrepancy

Only objects and symbols use `util.inspect`, others are simply
concatenated.

Fixes: https://github.com/iojs/io.js/issues/935
PR-URL: https://github.com/iojs/io.js/pull/1255
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
v1.8.0-commit
Brendan Ashworth 10 years ago
parent
commit
45814216ee
  1. 4
      doc/api/util.markdown

4
doc/api/util.markdown

@ -63,8 +63,8 @@ not replaced.
util.format('%s:%s', 'foo'); // 'foo:%s'
If there are more arguments than placeholders, the extra arguments are
converted to strings with `util.inspect()` and these strings are concatenated,
delimited by a space.
coerced to strings (for objects and symbols, `util.inspect()` is used)
and then concatenated, delimited by a space.
util.format('%s:%s', 'foo', 'bar', 'baz'); // 'foo:bar baz'

Loading…
Cancel
Save