doc: fix examples in repl.md
Checklist
-
documentation is changed or added -
commit message follows commit guidelines
Affected core subsystem(s)
doc, repl
- Update an example according to an actual REPL session.
- Replace an arrow function with a common function to hold
this
.