Skip to content

Commit cffbfba

Browse files
vsemozhetbytevanlucas
authored andcommitted
doc: replace anonymous functions in repl.md
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]>
1 parent f281b19 commit cffbfba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/api/repl.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,14 +328,14 @@ const repl = require('repl');
328328
const replServer = repl.start({prompt: '> '});
329329
replServer.defineCommand('sayhello', {
330330
help: 'Say hello',
331-
action: function(name) {
331+
action(name) {
332332
this.lineParser.reset();
333333
this.bufferedCommand = '';
334334
console.log(`Hello, ${name}!`);
335335
this.displayPrompt();
336336
}
337337
});
338-
replServer.defineCommand('saybye', function() {
338+
replServer.defineCommand('saybye', () => {
339339
console.log('Goodbye!');
340340
this.close();
341341
});

0 commit comments

Comments
 (0)