How does jsrepl work?Input and output are handled by separate text areas. The input area is used like a normal text editor, so the Return key inserts line breaks. If you want to evaluate expressions or statements, you have two options:
- Multi-line evaluation: select text and hit Shift-Return.
- Single-line evaluation: place the cursor in the line you want to evaluate and hit Shift-Return. If the cursor is at the end of a line, a newline will inserted.
Var declarations and function declarations work, but I had to use hacks to make them work , so you might not always get the results you expect.
Prior artjsrepl has been inspired by the Macintosh Programmer’s Workshop, which I have never used, but read about a long time ago (mid 1980s). There must be other prior art, too (Smalltalk, Lisp, ...).