May 18, 2021 WeChat Mini Program Development Document
var foo = 1;
var bar = "hello world";
var i; // i === undefined
The above code declares the three variables foo, bar, and i, respectively. The foo is then assigned a value of 1 and bar is assigned to the string "hello wolrd".
Variable naming must comply with two rules:
The following identifiers cannot be used as variable names:
delete
void
typeof
null
undefined
NaN
Infinity
var
if
else
true
false
require
this
function
arguments
return
for
while
do
break
continue
switch
case
default