Skip to content

Commit

Permalink
doc: replace anonymous functions in repl.md
Browse files Browse the repository at this point in the history
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 Jan 3, 2017
1 parent 532e56b commit 0cf6db8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/api/repl.md
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down

0 comments on commit 0cf6db8

Please sign in to comment.