- Sometimes the hardest part about learning how to program
is just how much is required of you before you start.
The nice thing about writing JavaScript
is as long as you have a browser and a text editor,
you already have everything you need to get started.
JavaScript was written for the browser.
So all modern browsers have a JavaScript engine
ready to execute your programs.
Attach a JavaScript file to your HTML file
using a script tag and the browser will execute your code.
If, however, you want to execute your JavaScript
on your local machine or on a server,
you'll need to load up a JavaScript runtime environment
to do that.
This became widely available in 2009
when Node.js was released.
Although there had been attempts
to create JavaScript runtime environments
outside of the browser before,
none of them had been particularly successful.
Node.js changed all of that.
And what had been primarily a language for the browser
became a language that could run web servers
and interact with databases.
There are a few differences
between running JavaScript in the browser versus in Node,
but the core language remains the same.
You already have everything you need
to get started writing JavaScript.
So go ahead and give it a try.