I would like to evaluate
var foo = \"foo\";
console.log(foo);
as a block, instead of evaluating line by line
var foo = \"f
You can use if(1){ to start a block that will not finish until you enter }. It will print the value of the last line of the block.
> {
... var foo = "foo";
... console.log(foo);
... }
foo
undefined
In multiline mode you miss out on a lot of REPL niceties such as autocompletion and immediate notification of syntax errors. If you get stuck in multiline mode due to some syntax error within the block, use ^C to return to the normal prompt.