How do I get console input in javascript?

前端 未结 4 2080
独厮守ぢ
独厮守ぢ 2020-12-04 17:21

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:

<         


        
4条回答
  •  眼角桃花
    2020-12-04 18:06

    Good old readline();

    See MDN docs: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Introduction_to_the_JavaScript_shell#readline.28.29

提交回复
热议问题