Where could you download the Java script
JS is run by the browser. You only have to include your script in a web page.
NodeJs is a good alternative to using a browser, if you just want to run some code in a terminal. You can download at: https://nodejs.org/en/download