Local JavaScript Variables
A variable declared inside a function has the scope only in that function, thus the variable is the local variable.
The variable doesn't have any recognition out side the function definition.
Local variables scope starts with function and gets deleted when the function execution completes.
For Example:
// code here can not use variable name
function fun() {
var name = "John";
// code here can use name
}
0 Comment(s)