jsnice
jsnice copied to clipboard
Variable from a top-level closure gets overridden in a nested level function which creates a new variable with the same name
I have a following case(I can understand its a very rare case)
(function() {
return (function(i) {
function() {
function() {
if() {
if(!i){
// this is replacing the value of i
// from top closures
var i = 'somehing';
// this variable should not be i
//call i from top closures
i() // error not a function
}
} else {
}
}
}
})
})()()