diff --git a/doc/api/repl.md b/doc/api/repl.md index cd4c3db9606711..268aa70c748006 100644 --- a/doc/api/repl.md +++ b/doc/api/repl.md @@ -328,14 +328,14 @@ const repl = require('repl'); const replServer = repl.start({prompt: '> '}); replServer.defineCommand('sayhello', { help: 'Say hello', - action: function(name) { + action(name) { this.lineParser.reset(); this.bufferedCommand = ''; console.log(`Hello, ${name}!`); this.displayPrompt(); } }); -replServer.defineCommand('saybye', function() { +replServer.defineCommand('saybye', () => { console.log('Goodbye!'); this.close(); });