Javascript redeclared global variable overrides old value
- by Yousuf Haider
I ran into an interesting issue the other day and was wondering if someone could shed light on why this is happening. Here is what I am doing (for the purposes of this example I have dumbed down the example somewhat):
I am creating a globally scoped variable using the square bracket notation and assigning it a value.
Later I declare a var with…