Using Atom with JavaScript

I would like to play around with JavaScript outside of Codecademy. I have the Atom development tool. When I try to test JS code in Atom outside of HTML, there does not seem to be a way of running it. Any ideas? Do I have to set up an HTML file first?

1 Like

Keep in mind that atom is an editor, not a javascript interpreter.

How you’d install and run programs in your environment has more to do with your environment than with javascript!

For example, on my end that looks like this:

$ sudo pacman -S nodejs    # install
$ nodejs helloworld.js     # run
Hello, World!              <- yay it runs and prints things

If you’re a windows user then it’s probably a whole lot more involved than that, starting with downloading nodejs with your browser, going through some graphical installer, and figuring out how to open some form of commandline interface and how to run nodejs from it

If anything, using a browser might be easier for you if you don’t already know how to do common tasks in your environment (because running it in the browser involves tasks that you are used to doing)

If there exists some plugin for your editor that installs nodejs for you and invokes it for you, then that’s between you and your editor (same thing really, knowing how to use your environment)
But I’d sooner suggest you run your code separately from your editor, because they are separate things, your editor is not an app which contains both your editor and your own program. It’s an editor. The app that you might imagine that your editor is, is actually your operating system (your operating system lets you run an editor and nodejs)

1 Like