-
A question about global variable
Hey folks,
the expression attached below defines a global variable, and I want to understand why the array gets automatically cleared after some time. How can I control when or if it gets cleared,thanks.
if (typeof $.globalVar !== “undefined”) {
$.globalVar.push(value)
} else {
$.globalVar = [value];
}
value;