summaryrefslogtreecommitdiff
path: root/doc/api/console.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/api/console.md')
-rw-r--r--doc/api/console.md5
1 files changed, 3 insertions, 2 deletions
diff --git a/doc/api/console.md b/doc/api/console.md
index 900a7aa9c1..1fc034e4f8 100644
--- a/doc/api/console.md
+++ b/doc/api/console.md
@@ -135,6 +135,7 @@ by extending Node.js' `console` and overriding the `console.assert()` method.
In the following example, a simple module is created that extends and overrides
the default behavior of `console` in Node.js.
+<!-- eslint-disable func-name-matching -->
```js
'use strict';
@@ -142,7 +143,7 @@ the default behavior of `console` in Node.js.
// new impl for assert without monkey-patching.
const myConsole = Object.create(console, {
assert: {
- value(assertion, message, ...args) {
+ value: function assert(assertion, message, ...args) {
try {
console.assert(assertion, message, ...args);
} catch (err) {
@@ -276,7 +277,7 @@ prints the result to `stdout`:
```js
console.time('100-elements');
-for (let i = 0; i < 100; i++) ;
+for (let i = 0; i < 100; i++) {}
console.timeEnd('100-elements');
// prints 100-elements: 225.438ms
```