Javascript in Shell
I used to test out Javascript in browsers' console. But I just found a way to run it in my Terminal.
- ln -s /System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc /bin/jsc
- $ jsc
- > "hello world"
- hello world
- > [] + {}
- [object Object]
- > {} + []
- 0
- > Array(16).join("haha" - 1)
- NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
- >
Categories: Javascript OS X



Discussion
the example works for my ibook and my ubuntu! thank you for sharing!
Leave a Comment :
Leave a Comment