I am writting a program in javascript that has two seperate functions that need to use a single variable (a "mode" variable).
I declare it globally, pass it to the first fnction, and then modify it inside the first function and it works fine. But when I try to grab the modified value in the second function, I get an undefined error. I am passing a text string to the mode variable in the first function from an inline function call.
(javascript:chooseMode('defalt'))