JavaScript Course Lesson 1 of 16
The Codex / JavaScript / What is JavaScript

What is JavaScript

A plain-English introduction to JavaScript — what it does, where it runs, and why it matters.

What it is, in plain English: JavaScript is a programming language that makes web pages interactive. It runs inside your browser (so users can click, type, and see things change) and also on servers (via Node.js, so you can build the backend too). One language — two homes.

JavaScript in plain English

Imagine a web page is a house. HTML is the walls and rooms — the structure. CSS is the paint and furniture — how it looks. JavaScript is the electricity — it makes things actually work. Lights turn on. Doors open. Things react when you touch them.

Without JavaScript, every web page is a static document — like a printed poster. You can read it, but nothing changes when you click. With JavaScript, a page becomes an application: buttons do things, forms validate your input before sending, content updates without reloading the page.

Two homes: browser and server

JavaScript is unusual because it runs in two completely different places:

🌐 In the browser

Every modern browser (Chrome, Firefox, Safari, Edge) has a JavaScript engine built in. When you visit a website, the browser downloads the JS file and runs it — no install needed. This is how Google Maps, Instagram, and YouTube work.

🖥️ On the server (Node.js)

In 2009, Node.js was invented so JavaScript could also run on a server — the computer that sends you the web page in the first place. Now the same language works everywhere: front-end, back-end, desktop apps, command-line tools.

This "two homes" fact is important because some things work in the browser but not Node.js (like document and window) and vice versa. We'll flag this clearly on every relevant page.

What JavaScript is used for

  • Web interactivity — menus, dropdowns, carousels, modals, form validation
  • Web applications — Gmail, Figma, Notion, VS Code (yes, VS Code is JS)
  • Backend APIs — via Node.js (Express, Fastify)
  • Mobile apps — via React Native
  • Desktop apps — via Electron (Slack, Discord, VS Code again)
  • Command-line tools — via Node.js

How JavaScript relates to Python

If you know Python: JavaScript has a very similar structure — variables, loops, functions, objects. The main differences you'll feel immediately:

  • JS has no significant whitespace — indentation doesn't matter, curly braces { } do
  • JS is weakly typed — it quietly converts between types (which causes surprises)
  • JS has two homes — browser and Node.js have different built-in tools
  • JS is asynchronous by nature — fetching data, waiting for clicks, timers are all central

How JavaScript runs

When a browser loads a JavaScript file, a program called the JavaScript engine reads and executes it. Chrome and Node.js use the V8 engine (written by Google in C++). Firefox uses SpiderMonkey. Safari uses JavaScriptCore. They all implement the same language standard (ECMAScript), so your code works the same everywhere.

You don't need to know how the engine works — just know that JS is interpreted (not compiled to a binary like C), runs line by line (mostly), and executes very fast because these engines are highly optimised.

A note on the name

JavaScript was named after Java in 1995 as a marketing move. They are completely different languages. Java is to JavaScript what "car" is to "carpet" — same letters, completely unrelated things. Don't let the name confuse you.

The official name of the language standard is ECMAScript (ES for short). When you see "ES6", "ES2020", "ES2023" — those are version numbers of the ECMAScript standard. JavaScript is the name we use in practice.

Try It Yourself

Official Sources

The Codex links only to official documentation and the ECMAScript specification. No third-party tutorials.