Introduction to ECMAScript
ECMAScript is the official rulebook for JavaScript. ES6, released in 2015, was the biggest upgrade the language ever had — and it is the JavaScript every modern job expects you to write.
On this page · 5 min · Beginner
On this page
- Learning objectives
- Explanation
- Code example
- Step by step
- Real-world use
- Common mistakes
- Best practices
- Remember this
- Practice exercise
- Mini quiz
- Related topics
- My notes
- Reading time
- 5 min
- Difficulty
- Beginner
- Updated
- Oct 28, 2026
Related tutorials
Learning objectives#
- Explain the relationship between ECMAScript and JavaScript
- Name the major ES versions and what they added
- Know how new features are added (TC39 stages)
- Decide when a transpiler like Babel is needed
Explanation#
ECMAScript (ES) is the specification; JavaScript is the language browsers and Node.js implement from it. Think of ECMAScript as the recipe and JavaScript as the dish.
ES5 (2009) was the standard for years. ES6 / ES2015 added let/const, arrow functions, classes, modules, promises, template literals, destructuring, Map/Set and more.
Since 2015 a new edition is published every June: ES2017 added async/await, ES2020 added ?. and ??, ES2023 added toSorted() and findLast(), ES2024 added Object.groupBy().
The TC39 committee moves proposals through stages 0–4. Only stage-4 features become part of the standard.
All modern browsers support ES2015–ES2023. You only need Babel (or TypeScript/esbuild output targets) if you must support very old browsers.
Code example: Five modern features in seven lines#
const user = { name: 'Asha', city: 'Pune' };
const { name, city } = user; // destructuring (ES2015)
const greet = n => `Hello, ${n} from ${city}!`; // arrow + template literal (ES2015)
console.log(greet(name));
const scores = [70, 85, 90];
console.log(Math.max(...scores)); // spread (ES2015)
console.log(user.address?.pin ?? 'no pin'); // ?. and ?? (ES2020)
Hello, Asha from Pune! 90 no pin
Step-by-step explanation#
- Destructuring pulls name and city out of the object in one line.
- The arrow function returns a template literal with values inserted by ${…}.
- Spread turns the array into separate arguments for Math.max.
- user.address is undefined, so ?. stops safely and ?? supplies the fallback.
Real-world use case#
React, Angular, Node.js and every modern library are written in ES2015+ syntax. Reading their docs and source code requires knowing these features.
Common mistakes#
ES6 is just a version of JavaScript. Old ES5 code still runs; ES6 adds new, nicer ways to write it.
Converting modern code to ES5 makes bundles bigger and slower. Check your real browser targets first.
Best practices#
- Write modern syntax by default
- Check support for brand-new features on caniuse.com or MDN
- Set a browserslist target so tools only transpile what is needed
- Follow TC39 proposals to see what is coming
Remember this#
ECMAScript = the recipe. JavaScript = the dish.
ES6 = ES2015. After that, one edition every year: ES2016, ES2017…
Big four of ES6: let/const, arrows, classes, modules.
Practice exercise#
Your task: Rewrite this ES5 code in modern syntax: var a = [1, 2]; var b = a.concat([3]); var msg = "Total items: " + b.length; console.log(msg);
Need a hint?
Show solution
const a = [1, 2];
const b = [...a, 3];
console.log(`Total items: ${b.length}`); // Total items: 3
Mini quiz#
ES6 is another name for…
Want more? Practise all ES6+ MCQs · ES6+ interview questions
My notes#
Saved in this browser.