Skip to content

Commit 3ae8d00

Browse files
tarunbatraMylesBorins
authored andcommitted
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 <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>
1 parent a714449 commit 3ae8d00

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
@@ -133,6 +133,13 @@ Each argument is converted to a string using `util.inspect()`.
133133
util.format(1, 2, 3); // '1 2 3'
134134
```
135135

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

0 commit comments

Comments
 (0)