Skip to content

Commit e51cbe9

Browse files
vsemozhetbytevanlucas
authored andcommitted
doc: fix examples in repl.md
* Update an example according to an actual REPL session. * Replace an arrow function with a common function to hold `this`. PR-URL: #12684 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 0c81002 commit e51cbe9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎doc/api/repl.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ replServer.defineCommand('sayhello',{
335335
this.displayPrompt();
336336
}
337337
});
338-
replServer.defineCommand('saybye', () =>{
338+
replServer.defineCommand('saybye', functionsaybye(){
339339
console.log('Goodbye!');
340340
this.close();
341341
});
@@ -440,6 +440,8 @@ without passing any arguments (or by passing the `-i` argument):
440440
```js
441441
$ node
442442
>consta= [1, 2, 3];
443+
undefined
444+
> a
443445
[ 1, 2, 3 ]
444446
>a.forEach((v) =>{
445447
...console.log(v);

0 commit comments

Comments
(0)