Is it possible for variables defined inside an inner function with the same name as a variable in an outer function to be isolated from the outer variable?
function() {
var myTest = "hi there";
( function( myLocalTest ) {
myLocalTest = "goodbye!";
} )();
console.log( myTest ); // myTest should still be "hi there" here, correct?
}
Typically, if I didn't declare myLocalTest
inside the inner function, it would create a closure and modify the original variable. I just want to confirm that variables declared within an inner function are always contained within that function even if their name conflicts with an outer scope.