diff --git a/doc/api/console.md b/doc/api/console.md index 3baac4bdac0da8..9e4548581b5f70 100644 --- a/doc/api/console.md +++ b/doc/api/console.md @@ -150,24 +150,23 @@ changes: * `value` {any} The value tested for being truthy. * `...message` {any} All arguments besides `value` are used as error message. -A simple assertion test that verifies whether `value` is truthy. If it is not, -or `value` is not passed, -`Assertion failed` is logged. If provided, the error `message` is formatted -using [`util.format()`][] by passing along all message arguments. The output is -used as the error message. +`console.assert()` writes a message if `value` is [falsy][] or omitted. It only +writes a message and does not otherwise affect execution. The output always +starts with `"Assertion failed"`. If provided, `message` is formatted using +[`util.format()`][]. + +If `value` is [truthy][], nothing happens. ```js console.assert(true, 'does nothing'); -// OK + console.assert(false, 'Whoops %s work', 'didn\'t'); // Assertion failed: Whoops didn't work + console.assert(); // Assertion failed ``` -Calling `console.assert()` with a falsy assertion will only cause the `message` -to be printed to the console without interrupting execution of subsequent code. - ### `console.clear()`