Back to JetBrains

Can we expect types in JavaScript?

JetBrainsSeptember 8, 20261m
In a Nutshell

The JavaScript community largely favors TypeScript-style type notation, and TC39 is considering adding a compatible subset of TypeScript types to the language. Enums and other incompatible features would be excluded. No champion is currently driving the proposal, so meaningful progress will require renewed effort.

AI-Generated Notes

These notes were generated by AI and may contain inaccuracies.

The question of what is meant by types requires clarification because different people understand different things when it comes to types. Some people refer to the possibility of putting type notation into the language, while others mean having actual type checking as part of the language.

It might be possible to have something like TypeScript where there is actual notation possibility for types. TypeScript evolved as a superset from JavaScript over time and has become very popular. TC39 cannot ignore the reality that users favor using TypeScript, and Microsoft has an interest in aligning with the language.

There was a proposal for adding types to the language as a set of features from TypeScript that are possible to be added in a way that they don't conflict. Some TypeScript features are not possible to use in JavaScript, with Enums being an example. Enums do not exist in JavaScript and would be something that cannot really be introduced.

It is believed that types can be added to JavaScript, though it will take time because there is currently no champion. The topic needs to be picked up again.

Sign in to read the full notes

Get access to AI-generated notes, topic timestamps, and more.