Vue [difference] var / let / const of

where       

  • Declare variables     
  • No district-level scope     
  • Can be pre-parsed       
  • You can repeat the definition
  • Declare global variables belonging to the top-level object (window) properties

let         

  • Declare variables     
  • There are block-level scope       
  • No pre-parsed         
  • The definition can not be repeated
  • Declare global variables are not top-level object (window) properties

const   

  • Statement read-only constants, once the declaration can not be changed       
  • There are district-level scope       
  •  No pre-parsed           
  • The definition can not be repeated         
  • Otherwise it must be assigned an error when defining
  • Declare global variables are not top-level object (window) properties

Guess you like

Origin www.cnblogs.com/websmile/p/11527621.html