I am reading the excellent Javascript documentation provided by Mozilla, and came across the section relating to Variable Hoisting
Coming from a programming background - this seems absolutely barking mad to me. I cannot possibly understand why such a feature (which could easily lead to logic bugs) - would be introduced into the design of the language.
I can see how function hoisting would be useful (if you wanted to keep all declarations to the bottom of a file - not sure why you'd want to do that though), but variable hoisting seems like absolute madness to me.
Am I missing something here ?