The Firebug console does exactly what you want, as does the Chrome Developer Tools (accessible by pressing F12 or by navigating through the menu).
I use kobyk's REPL on cscript.exe.
Also, I use emacs, and there is an elisp module that allows hosting of that REPL in emacs, called jsshell. This means you can do cut/paste, search/replace, command-line editing, and so on - all the text manipulation made available to emacs buffers is available in the interactive Javascript shell.
Welcome to the JScript shell.
Running JScript Version 5.8.16982
'exit' to exit.
js>
loading c:\dev\js\json2.js
js>
loading c:\dev\js\stringExtensions.js
js>
loading c:\dev\js\moment.js
js>
loading c:\dev\js\arrayExtensions.js
js>
Multi-line input. Use two consecutive blank lines to eval.
var id = "11111;22222;33333";
id = id.split(";");
js> function say (x) {WScript.echo(x);}
js> for (var i in id) { say (i); }
0
1
2
forEach
every
map
filter
remove
removeAt
indexOf
contains
js> for(var i=0;i<id.length;i++) { say (i + ": " + id[i]); }
0: 11111
1: 22222
2: 33333
js>