3

Does anyone know when the specifications for hoisting was introduced? And whether internet explorer version 6 supported it?

I didn't realize hoisting existed because these days, all my JavaScript code is transpiled.

I vaguely remember feeling proud on my first job as a web developer when I explained to my boss that his JavaScript program was crashing in IE6 or IE7 because he was invoking a function that was declared much later. I wonder if I have gone crazy and remembered things wrong?

John
  • 32,403
  • 80
  • 251
  • 422
  • 1
    I'm pretty sure hoisting worked in IE6 although I might be going crazy, too. I also tried to forget as much as I could about writing code for IE < 8, so I might have actually succeeded with that. – VLAZ Sep 27 '19 at 22:26
  • You might be rememering it slightly wrong, though - it might not have been a function declaration but a variable with a function expression, e.g., `fn(); var fn = function() {};` – VLAZ Sep 27 '19 at 22:27

1 Answers1

0

I believe that JavaScript has implemented hoisting from the beginning. According to the MDN article on hoisting:

Hoisting is a term you will not find used in any normative specification prose prior to ECMAScript® 2015 Language Specification.

I read this to say that ECMA 2015 is the first time the term was used in the language spec but that the concept existed prior to that.

Code-Apprentice
  • 81,660
  • 23
  • 145
  • 268