Browse Source

doc: replace anonymous functions in repl.md

Replaced with an object shorthand and an arrow function.

PR-URL: https://github.com/nodejs/node/pull/10244
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
v6
Vse Mozhet Byt 8 years ago
committed by Anna Henningsen
parent
commit
5f8aa1fcb1
No known key found for this signature in database GPG Key ID: D8B9F5AEAE84E4CF
  1. 4
      doc/api/repl.md

4
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();
});

Loading…
Cancel
Save