JavaScript and Where It Runs
JavaScript is a programming language. It is the language that web browsers understand, so almost every website that reacts to your clicks uses it. Brendan Eich created JavaScript at Netscape in 1995.
For many years, JavaScript ran only inside browsers. Then Node.js arrived in 2009. Node.js is a program that runs JavaScript outside the browser, so the same language can also run servers, command-line tools and desktop apps. That is one reason JavaScript is one of the most used languages in the world.
JavaScript is also forgiving. Sometimes it changes a value from one type to another without telling you. This feels easy at first, but it can hide mistakes. This course teaches the habits that keep your code correct, such as the === operator in the Operators section.
Your first JavaScript program
console.log("Hello, JavaScript!");
Output:
Hello, JavaScript!
console.log prints a value on the screen. You will use it in every lesson of this course. The quotes tell JavaScript that Hello, JavaScript! is text. The parentheses hold the value you give to console.log. The semicolon ; marks the end of the statement (one instruction).
JavaScript can often work out where a semicolon belongs if you leave it out. Most programmers still write them, and this course does too.
Your code here runs on Node.js. Node.js uses V8, the same JavaScript engine that runs inside the Chrome browser. So what you learn here also works in browser JavaScript. The last section of the course explains how the two fit together.
Your first exercise is already written for you. Submit it and see JavaScript print the greeting.