Learning modern JavaScript
JavaScript has different versions. Some of these are ES3, ES5, ES2015 (also known as ES6), and ES2016. Recent versions are named after the year in which they were introduced. Depending on the environment for which you write code, some features might be or might not be supported. TypeScript can compile new features of JavaScript to an older version of JavaScript. That is not possible with all features, however.
Recent web browsers support ES5 and they are working on ES2015.
We will first take a look at the constructs that can be transpiled to older versions.
let and const
ES2015 has introduced let
and const
. These keywords are alternatives to var
. These prevent issues with scoping, as let
and const
are block scoped instead ...
Get TypeScript: Modern JavaScript Development now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.