I installed SpiderMonkey on Mac using Homebrew.
$ brew install spidermonkey
Now you can execute JavaScript (from the SpiderMonkey engine) from the console using the js command.
$ js
js> print('お腹すいた' + '、と思ったか?');
お腹すいた、と思ったか?
js>
js> quit();
$
If you want to learn more about SpiderMonkey, please read this:
・SpiderMonkey (JavaScript-C) Engine
That’s all from the Gemba regarding SpiderMonkey installation.