Fix hoisting examples

Hoisting only happens to `var`. As kangax describes in [Why `typeof` is no longer “safe”](http://es-discourse.com/t/why-typeof-is-no-longer-safe/15/3).

Also, I wonder if we need the whole section, since you recommend to [avoid using `var` altogether](https://github.com/airbnb/javascript/blob/b492/README.md#references).
This commit is contained in:
Tomek Wiszniewski
2015-04-11 12:46:08 +02:00
committed by Josh Perez
parent ee176044c3
commit 0cca5e21fc

View File

@@ -1005,7 +1005,7 @@
anonymous(); // => TypeError anonymous is not a function
let anonymous = function() {
var anonymous = function() {
console.log('anonymous function expression');
};
}
@@ -1021,7 +1021,7 @@
superPower(); // => ReferenceError superPower is not defined
let named = function superPower() {
var named = function superPower() {
console.log('Flying');
};
}
@@ -1033,7 +1033,7 @@
named(); // => TypeError named is not a function
let named = function named() {
var named = function named() {
console.log('named');
}
}