Local variable
A variable whose name is bound to its value only within a local scope.
Example
js
let global = 5; // A global variable
function fun() {
let local = 10; // A local variable
}
See also
- Local variable on Wikipedia
A variable whose name is bound to its value only within a local scope.
let global = 5; // A global variable
function fun() {
let local = 10; // A local variable
}
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2024 by individual mozilla.org contributors. Content available under a Creative Commons license.