I try to use a global variable in my function, see below. I can use the global variable in my func1 to store a value, for Ex. 77, ok. In func2 I try to use the current value that is stored in the global variable but the result is undefined.
Any advice how to get this working?
doGet() {
...
var buttonValue;
...
func1(e,buttonValue) {
...
buttonValue = size;
throw buttonValue;
--> buttonValue ok!
...
}
func2(e,buttonValue) {
...
throw buttonValue;
--> buttonValue undefined!
}