1. The new way of variable declarations
let
And const
a variable declaration way JavaScript ES6 newly added. let
In many respects var
it is similar, but it can avoid some of the common problems in the JavaScript. And const则
is let
an enhanced, it will stop for a variable assignment (secondary assignment) again.
Because TypeScript is a superset of JavaScript, so it supports itself let
and const
.
⒉var statement