Created
July 16, 2017 01:27
-
-
Save t301000/402dad9d19b00a5803e8b842a77a62c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var a; | |
a = b = 3; | |
})(); | |
/* | |
a => 為 function 的區域變數,IIFE 執行完回收,ReferenceError: a is not define | |
b => 未用 var 宣告,所以會在 window 添加 b 屬性,其值為 3,IIFE 執行完依然存在 | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment