JS-02-js variable

. 1  <! DOCTYPE HTML > 
2  < HTML > 
. 3      < head > 
. 4          < Meta charset = "UTF-. 8" > 
. 5          < title > </ title > 
. 6      </ head > 
. 7      < body > 
. 8      <-! The JavaScript is a species a weakly typed language,
 . 9      the JavaScript variable type is determined by the value
 10      define the variable var keyword need
 11      is not used to define global var keyword variable will perform error in strict mode
 12 is      "use strict" -> 
13 is      <script>
14        // Note js which try to use the variable declaration var declared when 
15        // declare a variable 
16         var Test =  ' js ' ;
 . 17         Alert (Test);
 18 is         var A = . 1 , _B = 2 , C = . 3 ; // plurality of variable declarations are separated by commas 
. 19         Alert (A, _B, C); // error writing, only play the statement A 
20 is         Alert (C);
 21 is      </ Script > 
22 is      </ body > 
23 is  </ HTML >

 

Guess you like

Origin www.cnblogs.com/qinqin-me/p/11259489.html