local variable
nounUK /ˈləʊ.kəl ˈveə.ri.ə.bəl/
US /ˈloʊ.kəl ˈver.i.ə.bəl/
A local variable is a little box inside a function that holds a value only while that function is running.
The programmer used a local variable to store the total inside the function.
RELATED WORDS
OTHER MEANINGS
2. A variable declared inside a block of code that can only be used within that block.
The loop's local variable disappeared as soon as the loop finished.
3. In some languages, a variable that is created fresh each time a function is called.
Each call to the function creates a new local variable with the starting value.
4. A name that refers to a value only in the part of the program where it is defined.
Outside the method, the local variable cannot be seen or changed.