freecoding.school100% FREE · NO SIGNUP
Closure CavesISSUE #56 of 61

ES6 recap · let · const · arrow · class

LambdaVSThe Mutator
Lambda saysES6 (2015) was the big leap: let/const, arrow functions, classes, template literals, modules, and more.

ECMAScript 2015 (ES6) modernized JavaScript: block-scoped let/const, arrow functions, class syntax, template literals, destructuring, default/rest/spread, Map/Set, promises, and modules. Almost everything "modern JS" means started here. Since then, a new edition ships yearly with smaller, focused additions.

Power-ups you unlock

The Mutator attacks — common mistakes

Boss battleList which features you already use daily that arrived in ES6.

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre id="o"></pre>
<script>const sq=n=>n*n; const [a,b]=[1,2]; const merged={...{x:1}};
document.getElementById('o').textContent='arrow,destructure,spread — all ES6: '+sq(a+b)+' '+JSON.stringify(merged);</script></body></html>
▶ Open the interactive comic issue
‹ Modules · Re-Exports · Barrel FilesES2020 · Optional Chaining · Nullish Coalescing ›