1. Introduction to ECMAScript
Updated for ECMAScript 2025 (ES16). This tutorial includes ES2024/ES2025 features such as Array grouping, Promise.withResolvers, new Set methods, Iterator helpers, JSON modules with Import Attributes, RegExp modifiers and escape, and Float16 support.
What is ECMAScript?
ECMAScript is the standardized specification of JavaScript, the programming language that powers the web. It's maintained by Ecma International and defines the syntax, semantics, and libraries of JavaScript.
JavaScript vs ECMAScript
- JavaScript: The implementation of ECMAScript in browsers and Node.js
- ECMAScript: The specification/standard that defines how JavaScript should work
Why Learn ECMAScript?
- Web Development: Essential for front-end and back-end web development
- Cross-Platform: Runs on browsers, servers (Node.js), mobile apps, and more
- Large Ecosystem: Vast libraries, frameworks, and tools
- High Demand: One of the most popular programming languages
- Versatile: Can be used for web apps, APIs, games, automation, and more
Key Features
- Dynamic Typing: Variables can hold different types of data
- First-Class Functions: Functions are treated as first-class citizens
- Prototype-Based: Object-oriented programming through prototypes
- Event-Driven: Excellent for handling user interactions and asynchronous operations
- Interpreted: Code runs directly without compilation
Hello World Example
console.log("Hello, ECMAScript!");
What You'll Learn
This tutorial covers:
- Language fundamentals (variables, data types, operators)
- Control structures and functions
- Object-oriented programming
- Asynchronous programming
- Modern ES6+ features
- Best practices and patterns
What's New (ES2024–ES2025)
- Arrays/Collections: Array.group/groupToMap, new Set methods (union, intersection, difference, symmetricDifference, isSubsetOf/isSupersetOf/isDisjointFrom)
- Async: Promise.withResolvers (ES2024) and Promise.try (ES2025)
- Iterators: Iterator helpers (map, filter, take, drop, flatMap, reduce, toArray, etc.)
- Modules: JSON modules with Import Attributes (
with { type: "json" }) - RegExp:
vflag set notation, scoped modifiers(?i:...), duplicate named groups, andRegExp.escape() - Binary data: Resizable ArrayBuffer, ArrayBuffer.transfer, Float16Array, Math.f16round, DataView getFloat16/setFloat16
Next Steps
Ready to dive deeper? Let's explore the history and versions of ECMAScript to understand its evolution.