Functions in JavaScript

Everything in JavaScript is an Object. As we discussed in the previous post, JavaScript even treats the primitive data types as objects to provide additional functionality. Click here to see the example. Every programming language has functions, and a function is a reusable set of instructions. Apart from this, functions create their own scope. So

Read More


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