diff --git a/doc/api/repl.md b/doc/api/repl.md index e5d2fa41d6cb44..94714616a97831 100644 --- a/doc/api/repl.md +++ b/doc/api/repl.md @@ -341,7 +341,7 @@ replServer.defineCommand('sayhello', { this.displayPrompt(); } }); -replServer.defineCommand('saybye', () => { +replServer.defineCommand('saybye', function saybye() { console.log('Goodbye!'); this.close(); }); @@ -448,6 +448,8 @@ without passing any arguments (or by passing the `-i` argument): ```js $ node > const a = [1, 2, 3]; +undefined +> a [ 1, 2, 3 ] > a.forEach((v) => { ... console.log(v);