|
|
Line 271: |
Line 271: |
|
//can use x and y here, but NOT z |
|
//can use x and y here, but NOT z |
|
}</lang> |
|
}</lang> |
|
|
|
|
⚫ |
=={{header|JavaScript}}== |
|
|
|
|
⚫ |
There are not precisely any scope ''modifiers'' in JavaScript. |
|
|
|
|
⚫ |
The <code>var</code> variable declaration makes a variable local to a function, and function parameters are also local. Any variable not so declared is global, except in ES5 strict mode where an undeclared variable is an error. |
|
|
|
|
⚫ |
A named function definition (<code>function foo() { ... }</code>) is “hoisted” to the top of the enclosing function; it is therefore possible to call a function before its definition would seem to be executed. |
|
|
|
|
|
=={{header|Liberty BASIC}}== |
|
=={{header|Liberty BASIC}}== |
Line 286: |
Line 294: |
|
|
|
|
|
Some entitities are global by default. These include arrays, structs, handles and special variables such as DefaultDir$, WindowWidth, and ForegroundColor$ |
|
Some entitities are global by default. These include arrays, structs, handles and special variables such as DefaultDir$, WindowWidth, and ForegroundColor$ |
|
|
|
⚫ |
=={{header|JavaScript}}== |
|
|
|
|
⚫ |
There are not precisely any scope ''modifiers'' in JavaScript. |
|
|
|
|
⚫ |
The <code>var</code> variable declaration makes a variable local to a function, and function parameters are also local. Any variable not so declared is global, except in ES5 strict mode where an undeclared variable is an error. |
|
|
|
|
⚫ |
A named function definition (<code>function foo() { ... }</code>) is “hoisted” to the top of the enclosing function; it is therefore possible to call a function before its definition would seem to be executed. |
|
|
|
|
|
|
=={{header|Logo}}== |
|
=={{header|Logo}}== |