开发者

Interactive Javascript gem?

I've found some online interactive Javascript editors, but I wonder if there is a local equivalent as a gem that lets me 开发者_运维技巧test Javascript just like IRB and Rails console in Mac?


Try these:

  • red
  • johnson
  • therubyracer


Mozilla provides Rhino shell. Please note that it is based on an open source version of JavaScript built on Java.

Edit:

Since you are on a mac, you can use jsc which should be installed in: /System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc.

Found this little gem of info on this page.


Since Marcel Korpel has mentioned it as comment and might miss (I missed it first), entering it in here.

Fire up the console in Chrome/Firefox/Safari (Right click on the browser and say Inspect Element and look for Console tab) and start entering the commands that you wanna evaluate.

If you want to type multiple lines without each line being evaluated (like defining object/function), press SHIFT+Enter to go to next line (works in Chrome, have't checked in others)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜