Archives December 2018

Objects in JavaScript

An object in JavaScript (and perhaps in all other programming languages), is a collection of key-value pairs. Where key is the identifier and value is the value for that key. A simple object: There are other ways of creating an object, but this is the simplest version. This is also called the object literal notation.

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

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