Real newbie question about running JavaScript locally

So basically I thought it would be neat to run JavaScript code locally on my machine. For example, I’ll be following along with the Codecademy training, and there will be a “here’s what happens when we do this” sort of thing before the actual exercise that you type in the browser.

Of course, if want to do anything outside of the exercise in the code editor, Codecademy nags me with that red text that says something like “Did you do x to x?” And, yeah, I can ignore the message, but I want to stretch myself a bit.

Downloaded Visual Studio Community and Node.js. Installed. I figure out that JavaScript doesn’t do executables which makes sense because the web browser is the runtime interpreter or whatever it’s called for JavaScript. Not that I have any experience making executables in anything else.

I tried to open the basic Hello World .js file that I built using VS in Firefox, and it just renders the code as if I were opening it up in a text editor… it’s not actually executing it.

What’s the best way, given where I am now, to get a sort of JavaScript code playground I can mess with on my local machine, where I can write a source file and then get something to execute it and do math stuff and print things to the console? What’s the easiest way even if it’s not the best way?


– Mark

a browsers can render html, a html file can contain a <script></script> element pointing to your JS file.

Browsers have a built-in console (search for developer tools)

Always a bit tricky to figure this out the first time around.

1 Like

Makes sense. I know how to html well enough, I’ll just run stuff that way and will thwack the F12 key to get a console.

Many thanks. :slight_smile:

This topic was automatically closed 18 hours after the last reply. New replies are no longer allowed.