es6 of let

es5 provides two ways of declaring variables

  the function

es6 in offers four ways to declare variables

  let  const  class  import

Note: Do not ignore the private variable function parameter function;

var define the variable

  var features: variable lift but not defined, add a property to provide window

function defined variables

  function features: either upgrade also defined variables.

let define the variable

  1. There is no variable enhance the function can not be used before it is declared;

  

   

  2. The statement can not be repeated

  

 

  3. not add properties to the window

   

 

Guess you like

Origin www.cnblogs.com/bokeyanghao/p/11139357.html