ECMAScript and JavaScript

Understand the standard behind JavaScript and how runtimes implement language features.

Lesson content

🎯 Goal By the end of this lesson, you'll understand: What is JavaScript? What is ECMAScript? What's the difference between them? Why do developers say ES6 , ES2020 , etc.? Imagine This 📖 Think of ECMAScript as a recipe book 🍳. Think of JavaScript as the food made from that recipe. 📖 ECMAScript = Rules & Specifications 🍕 JavaScript = Actual Programming Language The recipe tells you how to make the food , but the food is what you actually eat. What is JavaScript? JavaScript is a programming language used to build: 🌐 Websites 📱 Mobile Apps 🖥️ Servers (Node.js) 🎮 Games Example: console . log( "Hello JavaScript!" ); Output Hello JavaScript! What is ECMAScript? ECMAScript is the official standard (rule book) for JavaScript. It defines: Variables Functions Classes Objects Arrays Promises Modules And many other language features It does not execute your code. It only defines how JavaScript should work . Who Creates ECMAScript? The ECMA International organization creates and updates the ECMAScript standard. Every year, new features are added. Real-Life Example 🚗 Imagine driving a car. 🚦 Traffic Rules = ECMAScript 🚗 Car = JavaScript Every car follows the same traffic rules. Similarly, every JavaScript engine follows the ECMAScript standard. JavaScript Engines Different browsers use different JavaScript engines. Browser JavaScript Engine Google Chrome V8 Microsoft Edge V8 Firefox SpiderMonkey Safari JavaScriptCore All of these engines follow the ECMAScript standard. Example ECMAScript says: Variables can be declared using let and const . JavaScript engines implement that feature. let name = "Ajay" ; const age = 30 ; console . log( name ); console . log( age ); Output Ajay 30 ECMAScript Versions Version Year Major Features ES5 2009 Strict Mode, JSON Support ES6 (ES2015) 2015 let , const , Arrow Functions, Classes, Template Literals ES2016 2016 includes() ES2017 2017 async/await ES2018 2018 Rest/Spread Improvements ES2019 2019 flat() , flatMap() ES2020 2020 Optional Chaining ( ?. ), Nullish Coalescing ( ?? ) ES2021 2021 replaceAll() ES2022 2022 Top-level await , Class Fields ES2023+ Latest New array methods and continuous improvements Before ES6 var name = "Ajay" ; function sayHello () { return "Hello" ; } After ES6 const name = "Ajay" ; const sayHello = () => "Hello" ; ES6 made JavaScript simpler and easier to read. JavaScript vs ECMAScript JavaScript ECMAScript Programming language Language standard Used to write applications Defines language rules Runs in browsers and Node.js Doesn't execute code Implemented by JavaScript engines Created by ECMA International Easy Formula ECMAScript │ ▼ Defines Rules │ ▼ JavaScript Engines (V8, SpiderMonkey, JavaScriptCore) │ ▼ Execute JavaScript Code Key Points ✅ JavaScript is the programming language you write. ✅ ECMAScript is the official specification for JavaScript. ✅ Browsers and Node.js implement the ECMAScript standard. ✅ ES6, ES2020, and newer versions are updates to the ECMAScript standard. Remember: ECMAScript = Rules 📖 JavaScript = Language 💻 V8/SpiderMonkey = Engines that run JavaScript 🚀