mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
doc: add single arg scenario for util.format
Set the expected outcome of `util.format('%%')` to be `%%`
instead of `%`.
PR-URL: https://github.com/nodejs/node/pull/12374
Fixes: https://github.com/nodejs/node/issues/12362
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
1 parent
8086cb68ae
commit
78af0df25e
1 file changed
+7
@@ -135,6 +135,13 @@ Each argument is converted to a string using `util.inspect()`.
|
||||
util.format(1, 2, 3); // '1 2 3'
|
||||
```
|
||||
|
||||
If only one argument is passed to `util.format()`, it is returned as it is
|
||||
without any formatting.
|
||||
|
||||
```js
|
||||
util.format('%% %s'); // '%% %s'
|
||||
```
|
||||
|
||||
## util.inherits(constructor, superConstructor)
|
||||
<!-- YAML
|
||||
added: v0.3.0
|
||||
|
||||
Reference in new issue
Block a user