From 0cca5e21fc66d6c5f076af71ab9a269a3ccddcc7 Mon Sep 17 00:00:00 2001 From: Tomek Wiszniewski Date: Sat, 11 Apr 2015 12:46:08 +0200 Subject: [PATCH] Fix hoisting examples MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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). --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0c1afab9..aaf2290f 100644 --- a/README.md +++ b/README.md @@ -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'); } }