Module 0 ¡ What JavaScript Is, Where It Runs, and How an Engine Runs It
What JavaScript Is (and Why It Is Not Java)
In this lesson
- Say what JavaScript is in one sentence, and what the word ECMAScript adds to it.
- Place JavaScript on a timeline from 1995 to ES2023, the level this track holds itself to.
- Tell JavaScript from Java with three concrete differences you can check in code.
Maria decides to learn JavaScript. She types "JavaScript course" into a search box. Half of what comes back teaches Java. One course opens with public static void main, and she wonders if she has already fallen behind.
She has not. She has met the oldest naming accident in programming. Java and JavaScript share four letters and very little else. As an old joke puts it, Java is to JavaScript what a car is to a carpet.
This lesson clears that up first, because every later lesson assumes you are reading about the right language. Then it gives JavaScript a date of birth, a standard and a version number you can point at.
JavaScript in one sentence
Here is the sentence to remember.
JavaScript is the programming language every web browser runs, standardised under the name ECMAScript, and now used on servers, phones and desktops too.
Three parts of that sentence matter. A programming language is a written set of rules for giving a computer instructions. A web browser is the program you use to open websites, such as Chrome, Firefox, Safari or Edge. Every one of them ships with JavaScript built in, so you do not install anything to use it.
The third part, "standardised", means a written rulebook exists. Anyone can build a program that reads JavaScript, as long as it follows that rulebook. That is why the same code runs in four different browsers made by four different companies.
So JavaScript is one language with one rulebook, and many programs that run it.
Java and JavaScript: two languages, one marketing decision
In 1995 a programmer named Brendan Eich built the first version of JavaScript at Netscape, the company behind the most popular browser of the day. He had about ten days. The language was called Mocha, then LiveScript.
That same year Sun Microsystems released Java, and Java was the most talked-about language in the industry. Netscape and Sun made a deal, and LiveScript was renamed JavaScript in December 1995. The name was marketing. The languages were already different, and they have grown further apart every year since.
| Java | JavaScript | |
|---|---|---|
| Made by | Sun Microsystems (James Gosling's team), 1995 | Netscape (Brendan Eich), 1995 |
| How it runs | Compiled first by javac into bytecode, then run by the Java Virtual Machine | Sent as plain text and run by an engine inside a browser or Node.js |
| Types | Every variable names its type: int count = 3; | No type is written: let count = 3; |
| Smallest program | Classically a class with a main method, five lines; Java 25 (2025) lets a tiny program drop the class line, but most courses still start with it | One line |
| Where you meet it | Android apps, bank and enterprise back offices | Every web page, and through Node.js on servers, phones and desktops |
If you only remember three lines of that table, take these. Java is compiled ahead of time into bytecode; JavaScript is sent as text and run by an engine. Java makes you write each variable's type; JavaScript does not. A Java program lives inside a class; a JavaScript program can be a single line.
Here is the same greeting in Java. Do not try to run it here. Just notice how much ceremony surrounds one line of work.
public class Hello {
public static void main(String[] args) {
String name = "Maria";
System.out.println("Hello, " + name + "!");
}
}
The JavaScript version is two lines, and you will see it in Example 2. So if a tutorial shows System.out.println or public static void, you are reading Java, not JavaScript.
A timeline from 1995 to today
JavaScript has changed a lot in thirty years. You do not need every date, but five of them explain most of what you will read online.
Between 1999 and 2009 the language barely moved. A big planned update, the fourth edition, was abandoned in 2008. ES5 in 2009 was a careful step instead. Then ES2015 arrived with so much at once that people still call everything after it "modern JavaScript".
Since 2016 a new edition has come out every year, each one small. So ES2022 and ES2023 differ by a handful of features. ES5 and ES2015 differ by a whole way of writing code.
ECMAScript, ES2015 and ES2023: what the names mean
The rulebook is not written by any one browser company. It is written by a committee called TC39, inside a standards body called Ecma International. The rulebook's official name is ECMA-262, and the language it describes is called ECMAScript.
Why the second name? The word "JavaScript" is a trademark, owned today by Oracle, which bought Sun. So the standard uses a name nobody owns. In practice, "JavaScript" is what people say and "ECMAScript" is what the rulebook says. They mean the same language.
Editions used to have numbers: ES3, ES5, ES6. Since 2015 they are named after their year. ES6 and ES2015 are two names for the same edition, and you will see both online.
Reading an edition name
ES2023
ESis short for ECMAScript, the standard's name for JavaScript.2023is the year that edition of the rulebook was approved.- Older names like
ES5andES6are edition numbers;ES6is the same asES2015.
This track writes ES2023 JavaScript. That matters for one practical reason. An engine (the program that runs JavaScript) only understands the features of the editions it was built for. Node.js 22, which runs your code on the Playground, understands all of ES2023. So nothing in this track will ask the Playground for a feature it does not have.
When a later lesson uses something newer, such as Object.groupBy from ES2024, it says so and marks it "ES2024". So the edition name is a promise about what will run.
Your first look at JavaScript code
You will run code properly in lesson 05. For now, read these three programs and their output. Each one is complete. The line console.log(...) means "print this", and lesson 05 explains it fully.
The smallest JavaScript program worth running. No class, no main, nothing to set up.
console.log("Hello, Maria!");
Hello, Maria!
The text inside the quotes is printed exactly as written. The quotes themselves are not printed.
Run in CompilerThis is the JavaScript twin of the Java program above. The name is stored once and used in the message.
const name = "Maria";
console.log("Hello, " + name + "!");
console.log("Welcome to JavaScript.");
Hello, Maria!
Welcome to JavaScript.
const name = "Maria"; gives the text a name. The + joins pieces of text together. Change "Maria" to your own name and the first line changes with it.
A program a beginner would actually write: a few facts stored as numbers, and one small sum.
const born = 1995;
const firstStandard = 1997;
const modern = 2015;
console.log("JavaScript was born in " + born + ".");
console.log("Its first standard came " + (firstStandard - born) + " years later.");
console.log("Modern JavaScript began in " + modern + ".");
JavaScript was born in 1995.
Its first standard came 2 years later.
Modern JavaScript began in 2015.
The brackets around firstStandard - born make JavaScript do the subtraction first. Module 2 explains why leaving them out gives a very different line.
If you did the C track
Here is Example 2 in C. The shape is the same, but C needs a header, a main function and a compile step before anything runs. JavaScript needs none of the three.
#include <stdio.h>
int main(void)
{
const char *name = "Maria";
printf("Hello, %s!\n", name);
printf("Welcome to JavaScript.\n");
return 0;
}
This track does not assume you know C. Every C comparison sits in a box like this one, and you can skip them all.
Where this is used
- This site. The Progsity pages you are reading are built with React and Next.js. They are written in TypeScript, which is JavaScript with types, and turned into plain JavaScript before your browser receives them.
- Gmail. Since 2004 the inbox has run as JavaScript inside the page. It fetches new mail and redraws the list without reloading the whole page.
- Figma. The menus, panels and comments run as JavaScript in the browser. The drawing canvas itself is a C++ engine compiled to WebAssembly, running beside it, which is an honest example of JavaScript working with another language.
- VS Code. Microsoft's code editor is written in TypeScript and runs on Electron, a desktop shell for JavaScript apps that lesson 02 explains.
- Netflix in a browser. The web player is JavaScript. It decides which quality of video to request next as your connection speeds up or slows down.
Common mistakes
1. Writing Java into a JavaScript file.
String name = "Maria";
console.log(name);
Node.js 22 refuses to run any of it: SyntaxError: Unexpected identifier 'name'. JavaScript has no type word in front of a variable, so String followed by another word makes no sense to it. The fix is const name = "Maria";. You will make this mistake if your first tutorial was secretly a Java tutorial.
2. Following a Java course by accident.
No error message warns you; you just get confused for a week. Check the first program of any course. If it has class, public static void main or System.out.println, it is Java. A JavaScript course starts with console.log or a web page.
3. Believing JavaScript is a toy for animating buttons.
That was close to true in 1997. Today VS Code, Discord's desktop app and the servers behind many large websites run on JavaScript. Learning it as a toy leaves you unready for the real thing.
4. Trying to "install ES2023".
An edition is a rulebook, not a download. What you install is an engine, and the engine decides which editions it understands. Node.js 22 already understands ES2023, so there is nothing else to fetch.
Open Example 2 with its Run link. Replace "Maria" with your own name, keeping the quotes, and press Run.
Check yourself. The first line of output reads Hello, followed by your name and an exclamation mark. If you see an error instead, check that both quotes are still there.
Sort these eight statements into three groups: true of Java only, true of JavaScript only, and true of both.
- Every browser can run it without installing anything.
- Its classic first program sits inside a class.
- It was first released in 1995.
- A variable is written with
letorconst. - It is compiled to bytecode by
javacbefore it runs. - Its standard is called ECMAScript.
- Every variable names its type, such as
int. - Its name is a trademark of Oracle.
Check yourself. You should end with three in each "only" group and two in "both". Statement 8 is the tricky one: it is about names, not code, so reread the section on ECMAScript.
Find out which edition added a feature. Search MDN (developer.mozilla.org) for Array.prototype.at and read its "Specifications" and "Browser compatibility" sections.
Rules. Write down the edition that added it, and say in one sentence whether this track's level, ES2023, includes it. Then find the first Node.js version that supports it in the compatibility table.
Check yourself. The edition is older than ES2023, so the track may use it, and Node.js 22 runs it. If your answer says it is "too new", read the edition name again: ES2022 comes before ES2023.
Common doubts
Do I need to learn Java before JavaScript?
No. They are separate languages, and neither is a step towards the other. This track starts from zero and assumes no other language.
Is TypeScript a different language?
It is JavaScript with types added on top. A tool turns TypeScript into plain JavaScript before it runs. Everything you learn here carries straight over, and lesson 03 shows how popular it has become.
Why do some websites say ES6 and others say ES2015?
They are the same edition. The committee switched from numbers to years in 2015, and older articles kept the old name. Today the year names are the official ones.
Which version of JavaScript do I have?
You have whatever your engine understands. A browser updated in the last year, or Node.js 22, understands everything this track uses. Lesson 05 shows you how to check the Node.js version.
Who owns JavaScript?
Nobody owns the language. TC39 writes the standard in public, and anyone may build an engine for it. Only the name "JavaScript" is a trademark, which is why the standard is called ECMAScript.
Key takeaways
- JavaScript is the language every web browser runs, standardised as ECMAScript, and now also used on servers, phones and desktops.
- Java and JavaScript share part of a name and some punctuation, and nothing else that matters.
- Java is compiled to bytecode, writes types and usually needs a class; JavaScript is run from text, writes no types and can be one line.
- Five dates: 1995 born, 1997 first standard, 2009 ES5 and Node.js, 2015 modern JavaScript, a new edition every year since.
- This track writes ES2023, and Node.js 22 on the Playground runs all of it.
Next you will find out where JavaScript actually runs. It is four places, and one of them is in your pocket.
End of lesson 1
Mark it done, and your progress moves with you.
Next: Where It Runs: Browser, Server, Phone, Desktop