Key facts
| Gen 1 | |
|---|---|
| Gen 2 | |
| Kind of tool | Languages and runtimes |
| Status of Gen 1 | Still active No standards body or browser maker has deprecated ES5 code. MDN describes var as 'well established' and works across many devices and browser versions, with no deprecation notice, and the ECMAScript 2026 specification, 17th edition, is dated June 2026. |
| Effort to move | Mechanical: same ideas, different calls |
| What breaks | var and let scope differently, module scripts are deferred and run in their own scope, arrow functions have no this of their own, and code that relied on top-level globals stops finding them. |
| Should you move? | Move when convenient ES5 code keeps working, so no date is forced, but every feature added since 2015 is built for modules, let, const, classes and promises. This is gen2.dev's view, not the maintainers'. |
| Sources checked | 2026-11-28, 8 sources |
This is a style change, not a product change, and nobody has switched the old style off.
What Gen 1 was
ES5 is the JavaScript standard of December 2009, the 5th edition of ECMA-262. The next edition, the 6th, is dated June 2015.
Code from that era has a recognizable shape. Scripts load through plain script tags and share global variables. Variables use var. Objects come from constructor functions and their prototypes. Asynchronous work uses callbacks passed into other functions.
A word on "vanilla JavaScript": it means JavaScript with no framework or library. It is not an old version, and vanilla code can use every feature below.
What replaced it
The 6th edition (ECMAScript 2015) and the editions after it. The Ecma International page now lists the 17th edition, ECMAScript 2026, dated June 2026.
The pieces most code moves to, all documented by MDN:
- let and const instead of
var. MDN: "letdeclarations are scoped to blocks as well as functions." - Classes instead of hand-written prototype setup. MDN: "Classes in JS are built on prototypes but also have some syntax and semantics that are unique to classes."
- Arrow functions for short functions that should keep the surrounding
this. - Promises, async and await instead of nested callbacks. MDN says await "enables you to write code that uses asynchronous functions but looks like synchronous code."
- Modules, loaded with
<script type="module">, instead of globals shared between script tags.
What moving involves
File by file. Nothing requires a rewrite, and the old and new styles can sit in the same codebase, which is the strangler fig pattern at the scale of a file.
A sensible order, easiest first:
vartoconst, and toletwhere the value changes.- Callbacks to promises, then to
asyncandawait. - Constructor functions to classes, where the code reads better for it.
- Script-tag globals to modules: give each file
importandexportlines, then load the entry file withtype="module".
The modules step is the large one, because it changes how files find each other.
What breaks
Scope. MDN describes var as "function-scoped or globally-scoped" and warns that "a variable can appear to be used before it's declared." A let in the same position sits in a temporal dead zone and throws a ReferenceError. A let also cannot be declared twice in one scope, which a var allowed.
Modules. MDN says modules "are automatically in strict mode" and "are executed in their own scope, not in the global scope." So a variable one script defined for the others is not visible unless it is exported or attached to window. Module scripts "defer by default," so code that expected to run at the point of the tag runs later.
this. MDN: "Arrow functions don't have their own bindings to this, arguments, or super, and should not be used as methods." Converting every function to an arrow can break code that depends on how it is called.
Old browsers. The same MDN pages date these features to browser support in 2015 and 2016, so only a codebase that still serves browsers older than that is affected.
Should you move?
Move when convenient. That is gen2.dev's opinion and the site owner's, not a statement from the standards body.
ES5 code is not unsupported. MDN's page on var says the feature "is well established and works across many devices and browser versions," and no source here announces an end date for it. The reason to move is gen2.dev's judgment: modules, let, const and classes are how the language has been written since 2015, and old code gets harder to share with code written that way.
Do it as you touch files: start with var and callbacks, which carry the least risk, and leave the module step for a day when you can test every page. A stable file that works can stay as it is. Write all new code in modern JavaScript.
Common questions
Is ES5 JavaScript dead?
No. Its maintainers have not announced an end. No standards body or browser maker has deprecated ES5 code. MDN describes var as 'well established' and works across many devices and browser versions, with no deprecation notice, and the ECMAScript 2026 specification, 17th edition, is dated June 2026.
What replaced ES5 JavaScript?
Modern JavaScript: ES modules and ES2015 and later features (ECMA-262 6th edition, June 2015, and every edition since). Effort to move: Mechanical: same ideas, different calls
Should I move off ES5 JavaScript?
gen2.dev's view: Move when convenient. ES5 code keeps working, so no date is forced, but every feature added since 2015 is built for modules, let, const, classes and promises.
Sources
- ECMA-262 - Ecma International - the 5th edition dated December 2009, the 6th edition dated June 2015, and the latest edition, the 17th, ECMAScript 2026, dated June 2026
- JavaScript modules - MDN Web Docs - that modules are automatically in strict mode, run in their own scope and not the global scope, can be loaded with type="module", and can still read globals from classic scripts
- <script>: The Script element - MDN Web Docs - that module scripts defer by default and that the defer attribute has no effect on them
- var - MDN Web Docs - that var is function-scoped or globally scoped, how hoisting works, and that it has been available across browsers since July 2015
- let - MDN Web Docs - that let is block-scoped, the temporal dead zone, and that a let cannot share a scope with another declaration of the same name
- Arrow function expressions - MDN Web Docs - that arrow functions have no this of their own and take it from the enclosing scope, and that they have been available across browsers since September 2016
- Classes - MDN Web Docs - that classes are built on prototypes but have syntax and semantics of their own, and that they have been available across browsers since March 2016
- How to use promises - MDN Web Docs - the difference between passing a callback in and getting a promise back, and how async and await make asynchronous code read like synchronous code
Sources checked on 2026-11-28. Tools change status quickly; if this date is old, read the sources before acting on it.

