Run the files using following command
node {js filename}
Pre requiste Install Node (https://nodejs.org/en/download/package-manager/) on your machine. Alternatively you can run the following code on the browser and check the console output for results.