And why nodejs doesn't know that?
exit and quit could be variable names so we have .exit. we could do what python does and show a warning when those keywords are asked for without being assigned
we could do what python does and show a warning when those keywords are asked for without being assigned
that's better, or you could forbid people to define global variable named "quit" or "exit" only in REPL just like what ipython already did and that is considered user friendly.
Agreed that this isn't a great user experience.

ReferenceError: quit is not defined
I'd assume the chances of someone typing quit or exit by themselves into the repl, when they're not defined, and not wanting to quit the repl should be vanishingly rare.
I've modified the title to be a little bit more friendly.
Would you all be opposed to prompting for clarification? The repl makes you type CMD-C twice to exit.
You could do something like:
> exit
Did you mean '.exit' [Y/n]?
It could default to YES, so, if they simply press return, they鈥檒l exit. If they say NO, it will proceed to run as if exit is a reference.
Benefits:
Most helpful comment
Would you all be opposed to prompting for clarification? The repl makes you type
CMD-Ctwice to exit.You could do something like:
It could default to YES, so, if they simply press return, they鈥檒l exit. If they say NO, it will proceed to run as if exit is a reference.
Benefits: