Skip to content

Commit ed13016

Browse files
tarunbatraevanlucas
authored andcommittedMay 2, 2017
doc: add single arg scenario for util.format
Set the expected outcome of `util.format('%%')` to be `%%` instead of `%`. PR-URL: #12374 Fixes: #12362 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Alexey Orlenko <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent aa51105 commit ed13016

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
 

‎doc/api/util.md

+7
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,13 @@ Each argument is converted to a string using `util.inspect()`.
135135
util.format(1, 2, 3); // '1 2 3'
136136
```
137137

138+
If only one argument is passed to `util.format()`, it is returned as it is
139+
without any formatting.
140+
141+
```js
142+
util.format('%% %s'); // '%% %s'
143+
```
144+
138145
## util.inherits(constructor, superConstructor)
139146
<!-- YAML
140147
added: v0.3.0

0 commit comments

Comments
 (0)
Please sign in to comment.