We can run our JavaScript in multiple ways on your system. You can choose anyone of the those type which is suitable for you and your system.
JS Engine on Browsers
Almost all the browsers have sophisticated DOM to display the webpages to users. Webpages uses technologies like Javascript so we can run our Javascript using browsers too. These are the list of JS Engine used in famous browsers,
V8 is developed and used in Google Chrome browser.
SpiderMonkey is developed and used in Mozilla Firefox browser.
JavaScriptCore is used in Safari browser.
Chakra is used in Internet Explorer browser.
How to run JS in browsers ?
Open you preferred browser and select developer option in it. In the console windows enter you Javascript command and press enter then you will find output below.
Webpages also contains Javascript in them, these compilation are usually hidden from users when displaying Webpages so when the code break or when error occurs you won't be able to see then unless developer option is enabled.
Java Scripting Page
Create a simple HTML page as shown below,
Open the sample HTML in a web browser, when this HTML is opened DOM in the browser engine will construct the content in the HTML and then also execute the script (all at the same time).
To confirm this open up the developer tool in the browsers and you will see the console printed in it.
Node JS
As an asynchronous event-driven JavaScript runtime, Node.js is designed to build scalable network applications(source).
You can pass JS commands to terminal once we have installed Node JS to your system. Follow the instructions to install one onto the system. Visit the link, download the appropriate package for your system.
Click and run the program with admin privileges. Open your terminal and issue the following command node -v, if the application is successfully installed on your system the you will get similar output like the one below.