Skip to content
Permalink
Browse files

doc: replace anonymous functions in repl.md

Replaced with an object shorthand and an arrow function.

PR-URL: #10244
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information...
vsemozhetbyt authored and evanlucas committed Dec 12, 2016
1 parent f281b19 commit cffbfba4df31f546261a65301ee842cbff323d19
Showing with 2 additions and 2 deletions.
  1. +2 −2 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();
});

0 comments on commit cffbfba

Please sign in to comment.
You can’t perform that action at this time.