Is there any support for static typing in ECMAScript 6? How about ECMAScript 7?
In the JavaScript community, Flow and TypeScript have emerged as the two main options for enabling static type checking: Flow is a static type checker for JavaScript. It is an open-source tool developed by Facebook. TypeScript is a statically typed superset of JavaScript that compiles to plain JavaScript.
The ECMAScript language types are Undefined, Null, Boolean, String, Number, and Object. Now, if you're a fan of strongly typed (statically typed) languages, you may object to this usage of the word “type.” In those languages, “type” means a whole lot more than it does here in JS.
If you don't know, static typing is when the compiler enforces that values use the same type. Here's an example. This is valid in JavaScript: let value = 5; value = "hello"; Here, the type of value changes from a number to a string.
No.
But on the ECMA-Script Wikipage there is a paragraph about changes in ECMA-Script 7:
The Seventh Edition is in a very early stage of development, but is intended to continue the themes of language reform, code isolation, control of effects and library/tool enabling from ES6. New features proposed include promises/concurrency, number and math enhancements, guards and trademarks (an alternative to static typing), operator overloading, value types (first-class number-like objects), new record structures (records, tuples and typed arrays), pattern matching, and traits.
Which may interest you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With