Skip to content

Instantly share code, notes, and snippets.

@sean-clayton
Created March 10, 2021 15:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sean-clayton/6aa48144f722c860b7454133cdbd5ac5 to your computer and use it in GitHub Desktop.
Save sean-clayton/6aa48144f722c860b7454133cdbd5ac5 to your computer and use it in GitHub Desktop.
JavaScript through the Years

JavaScript through the Years

Brief History Lesson

1995

Brenden Eich creates JavaScript in 10 days at Netscape and it is released in December.

1996

Microsoft creates JScript to run in IE 3.0, released in August. Netscape saught Ecma International in November to standardize the specification of their JavaScript language. ECMA-262 (the standard) was born in that same month by Ecma Technical Committee (TC) 39. ECMAScript was chosen as the name as a compromise between TC39 members Netscape and Microsoft.

2000-2009

After several years since the first ECMAScript specification, several major versions of ECMAScript have been released and more companies entered the discussion around standardization of ECMAScript. A 2nd, 3rd, and (abandoned) 4th edition have been created and utilized throughout the software world. ES4 was proposed to make extremely large changes to ES3. TC39 members Adobe, Mozilla, Opera, and Google wanted to continue with the large update of ES4. TC39 members Microsoft and Yahoo wanted to make a smaller spec update dubbed "ES3.1" and actually went on to do that outside of TC39.

In the end, after much deliberation and discussion, EC3.1 would continue on as a renamed ES5. The most important thing from this was that TC39 agreed that any new features/ideas would only ever be developed if and only if the entire TC39 has consensus. This is to prevent this sort of thing from happening again.

2015

ES6/ES2015 is released in June. It implements most of what ES4 wanted to achieve (classes, a module system, generators, destructuring assignment). It also shed light on that decision made before: Reaching consensus with so many TC39 members is a hard thing to do with the large amount of features ES2015 shipped with. To prevent so much time passing between new spec updates, two things were born: Smaller, yearly spec releases, and the TC39 process.

TC39 Process

The TC39 process is a clear and defined way (well, as clear and defined as it can get with such an involved committee-designed spec)

  • Stage 0
    • "Strawman" - A documented idea that is presented by a TC39 member or registered TC39 contributor.
  • Stage 1
    • "Proposal" - Formal proposal for the strawman idea. Must be championed by a TC39 member. Needs lots of discussion on things like the API and obstacles to hurdle. Also needs polyfills and demos developed.
  • Stage 2
    • "Draft" - TC39 has declared to willingly examine, discuss, and contribute to the Proposal. A draft must include formal description of semantics and syntax of the idea. Two experimental implementations are required, but one can be in a transpiler like Babel. This stage indicates that the committee expects these features to be developed and eventually included in the standard.
  • Stage 3
    • "Candidate" - The draft can only have been incrementally changed to get to this point. Once here, the text must be complete. The spec is signed off. Must have 2 spec-compliant implementations (in browsers, for example).
  • Stage 4
    • "Finished" - To get here, only critical issues can have changed the spec. Language spec acceptance tests must be passed. 2 spec-compliant implementations must pass acceptance tests. Another spec sign-off. Once here, it is ready to be included in the next yearly standard (or one after that).

ES2016

  • Array.prototype.includes (Does not work with objects)
const a = true;
[1, 2, 3].includes(2); // true
[1, 2, 3].includes(4); // false
[{ a }].includes({ a }); // false
  • Exponentation operator (**)
x ** y === Math.pow(x, y) // true

ES2017

  • Async/Await
const a = n => n * 2;
const b = async a => b => a(b);
const c = await b(a)(2); // 4
  • Shared memory and atomics
  • Object.values/Object.entries
const obj = { a: 1, b: 2 };
Object.keys(obj); // ["a", "b"]
Object.values(obj); // [1, 2]
Object.entries(obj); // [["a", 1], ["b", 2]]
  • String padding (lol leftpad)
  • Object.getOwnPropertyDescriptors()
  • Function parameters can have trailing commas
function(
  a,
  b,
) {
  return a(b);
}

ES2018

  • Async iteration
    • Essentially async support for the synchronous iteration brought in ES6
for (const data of fetch('https://cool.api/bro')) {
  console.log(data)
}
  • Rest/spread properties
const obj = { a: 1, b: 2, c: 3 };
const { a, ...rest } = obj;
// a = 1, rest = { b: 2, c: 3 }
const newObj = { a, ...rest };
// newObj = { a: 1, b: 2, c: 3 }
  • Regex named capture groups
  • Regex unicode property escapes
  • Regex lookbehind assertions
  • Promise.prototype.finally()
coolPromise
  .then(c => c.stuff)
  .catch(e => throw new Error(e))
  .finally(() => { console.log(`I'm always ran! And always last!`); })
  • Template literal revision

ES2019

  • Array.flat()
  • Array.flatMap()
  • String.trimStart() and String.trimEnd()
  • Object.fromEntries()
  • Function.toString()
  • Symbol.description property
  • Optional catch binding

ES2020

  • Private class variables
  • Promise.allSettled()
  • Nullish Coalescing Operator
  • Optional Chaining Operator
  • BigInt
  • Dynamic Import syntax
  • import.meta

ES2021

  • String.replaceAll()
  • Promise.any()
  • Logical Assignment Operators
  • WeakRef
  • Numeric Seperators

ESNext

  • JSON Modules
  • Import Assertions
  • Top-level await

Links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment