diff --git a/doc/api/repl.md b/doc/api/repl.md index b15142910f..60c200699a 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);