Skip to content

Instantly share code, notes, and snippets.

@ramazankanbur
Created November 11, 2019 11:52
Show Gist options
  • Save ramazankanbur/4db68b18177ce555ec61a4a69b0f4aa8 to your computer and use it in GitHub Desktop.
Save ramazankanbur/4db68b18177ce555ec61a4a69b0f4aa8 to your computer and use it in GitHub Desktop.
///// 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