No block scope

Note that unlike C, C++, and Java, JavaScript does not have lock-level scope. All variables declared in a function, no matter where they are declared, are defined throughout the function.

it is good programming practice to place all your variable declarations together at the start of any function.

你可能感兴趣的:(JavaScript,java,C++,c,C#)