TC39

TC39(Technical Committee 39) is a committee that evolves JavaScript.

Who is TC39

Its members are JavaScript engines、Frameworks、Academics、Major website/app platforms, now are there some Chinese companies!

Every two months, TC39 has meeting. The minutes of those meetings are public in github

The TC39 process

  • Stage 1: An idea under discussion;
  • Stage 2: We want to do that and we have a draft;
  • Stage 3: We have a final draft and ready to go;
  • Stage 4: 2+ implementation, Test262 => standard;

ES2016 was the first ECMAScript version that was designed according to the TC39 process.

tc39-process: this article introduces the conditions of each stages should achieve.

Finished Proposals(stage 4)

Once a feature is reached to stage4, it runs all test case in Test262, so you can use it safely. But even then, you should still check if the device environment you use supports it. You can see all the finished feature and other proposals in the official list.

  • BigInt
  • Dynamic import()
  • Optional chaining
  • Nullish coalescing
  • globalThis
  • ...

BigInt

const expected = 4n / 2n;
// ↪ 2n
const rounded = 5n / 2n;
// ↪ 2n, not 2.5n

The / operator also work as expected with whole numbers. However, since these are BigInts and not BigDecimals, this operation will round towards 0, which is to say, it will not return any fractional digits.

Polyfilling and transpiling BigInts

Unlike most other modern JavaScript features, BigInts cannot reasonably be transpiled down to ES5.

The BigInt proposal changes the behavior of operators (like +, >=, etc.) to work on BigInts. These changes are impossible to polyfill directly, and they are also making it infeasible (in most cases) to transpile BigInt code to fallback code using Babel or similar tools. The reason is that such a transpilation would have to replace every single operator in the program with a call to some function that performs type checks on its inputs, which would incur an unacceptable run-time performance penalty. In addition, it would greatly increase the file size of any transpiled bundle, negatively impacting download, parse, and compile times.

link