Today, I got completely surprised when I saw that a global variable has undefined
value in certain case.
Example:
var value = 10;
functi
I was running into the same problem even with global variables. My problem, I discovered, was global variable do Not persist between html files.
I tried to reference myVar and myVarTwo in the loaded HTML file, but received the undefined error. Long story/day short, I discovered I could reference the variables using: