Skip to content

[node:util] format is optional in util.format? #45669

Open
@Semigradsky

Description

@Semigradsky

Affected URL(s)

https://nodejs.org/docs/latest-v18.x/api/util.html#utilformatformat-args

Description of the problem

By https://nodejs.org/docs/latest-v18.x/api/util.html#utilformatformat-args has required string argument util.format.

But in examples we see:

If the first argument does not contain a valid format specifier, util.format() returns a string that is the concatenation of all arguments separated by spaces:

util.format(1, 2, 3);
// Returns: '1 2 3'

Looks like it the same as having optional format argument.
So it shoud be util.format([format [, ...args]]) instead of util.format(format[, ...args]).

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to the documentations.utilIssues and PRs related to the built-in util module.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions