Why do you bind?

Have you ever run into a problem where you have added an event listener using bind, but the event handler continues to execute even though you have removed the listener? If yes, read on. A few months ago, when I was working on one of the React components, I added an event listener to the

Read More


Undefined Vs Null

In JavaScript, both undefined and null come under primitive data types. But they are not as simple as a string, number, and boolean. A variable is said to be undefined when it has been declared (for future use) but has no value assigned to it. For example, Line 2 prints undefined in double quotes, i.e.

Read More


Data Types in Javascript

JavaScript is not strict when it comes to data types and use of variables if we are writing codes without using ‘use strict’. None of the code example in this post has been written with ‘use strict’ option. As a result, we can use a variable (without declaring it) and the JavaScript engine won’t have

Read More


Sort an Array of Objects

Sorting of data is a common problem. Whenever we check something on the internet, be it clothes, flights, shoes, or any other item, the first thing (most of the time) we do is, sort the result. Each website provides sorting based on price, recommendations, popularity, and so on. So how do we sort data? There

Read More


What Changed with Arrow Functions

With the introduction of the arrow functions in JavaScript, everyone is happy. Well, why shouldn’t we be? It clears one of the biggest confusion in JavaScript. The confusion with the scope inside an event handler or a callback function, or to be precise scope within a scope. When ES6 was introduced, it removed the traditional

Read More