When you declare a variable inside a function using the var keyword, the scope of the variable is local. For example:
function increase() {
    var counter = 10;
}
// cannot access the counter variable here
In this example, the
counter
variable is local to the increase() function. It cannot be accessible outside of the function.
by Luka Tatarishvili
4 years ago
JavaScript
variables
0
Pro tip: use ```triple backticks around text``` to write in code fences