Tag scope

Closure – II

Let us see another famous and good example for understanding the concept of closure. A prior knowledge of how callbacks and event loop work in JavaScript is required. setTimeout is not a native function in JavaScript. It is an API similar to XMLHttpRequest which enables us to extend JavaScript to asynchronous in nature. setTimeout is a

Read More

Closure – I

The closure “was” and has been one of the most interesting and important concepts of Javascript. I have written “was” because, now that most of the “new” developers are using ES6 and maybe ES7, they might never come across the concept of what closure is and its usage. For those who are or end up

Read More