I want to define a variable (Boolean), and then use it in a function two times. I started with defining a global variable, and then use this variable locally in my function as follows:
var inpLock = false;
…
function doSomething(inpLock) {
inpLock = true;
switch …
case
case
inpLock = false;
}
What happens by running this is: it sets the variable to true but not back to false. If I declare the variable inside the function like: var inpLock it also won’t work. Any help will be appreciated.