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 <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
vsemozhetbyt authored and evanlucas committed Jan 4, 2017
1 parent f281b19 commit cffbfba
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 cffbfba

Please sign in to comment.