Created
November 11, 2019 11:52
-
-
Save ramazankanbur/4db68b18177ce555ec61a4a69b0f4aa8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| ///// block-scoped function ES5 | |
| (function(){ | |
| function privateFunc(){ | |
| console.log("Bu scope dışından erişelemez"); | |
| (function(){ | |
| console.log("Bu scope dışından erişilemez, privateFunc'tan da erişilemez"); | |
| })(); | |
| } | |
| privateFunc(); | |
| })(); | |
| console.log('-----------------'); | |
| ///// block-scoped function ES6 | |
| { | |
| function privateFunc(){ | |
| console.log("Bu scope dışından erişelemez"); | |
| { | |
| console.log("Bu scope dışından erişilemez, privateFunc'tan da erişilemez"); | |
| } | |
| } | |
| privateFunc(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment