I am learning JavaScript and I am using Atom (Text Editor). On my HTML file I got only this:
It looks like you are trying to run the JS code with the "script" package in atom (which is in a NodeJS context). What you actually want to do, is to run it in your web browser. So just open index.html in your favorite browser and see the magic :)
index.html