views:

88

answers:

1

I'm currently using spidermonkey to run my javascript code. I'm wondering if there's a function to get input from the console similar to how python does this:

var = raw_input()  

Or in C++:

cin >> var;

I've looked around and all I've found so far is how to get input from the browser using the prompt() and confirm() functions.

+3  A: 

Good old readline();

https://developer.mozilla.org/En/SpiderMonkey/Introduction_to_the_JavaScript_shell#readline()

MooGoo
That's exactly what I was looking for. Thank you.
camel_space