Simplifying Object.assign method in JavaScript

Read full article on the Infragistics blog “In JavaScript, Object’s assign method copies source object’s own enumerable properties to a target object, and returns that target object “ There are two important keywords in the above sentence: Enumerable Own Before we go ahead and understand purpose of Object.assign, it is essential that we really understand these two words, … Continue reading Simplifying Object.assign method in JavaScript

Video – JavaScript object instances does not copy definition from the class

I recently wrote a blog post about Two Problems of a JavaScript Class. In my opinion one gotchas in a JavaScript class is , object instances does not copy definition from the class. Watch this video to understand it through codes.  f you like the video , do not forget to subscribe to our YouTube Channel for notification about … Continue reading Video – JavaScript object instances does not copy definition from the class

How to add a static member property in a JavaScript class?

Recently while solving a problem, I came across a requirement to create a property in a JavaScript class, which needs to be shared by all the object instances. In the programming world, these types of properties are called Static Properties. There are various scenarios when you need a static member property: When counting number of … Continue reading How to add a static member property in a JavaScript class?

How to Create Basic Inheritance in JavaScript Constructors

There are four ways to create an object in JavaScript. They are as follows: Object as literal Constructor Invocation Pattern Object.create() method Using class after ES6 Implementation of Inheritance varies according to the object creation method. In this post, I am going to explain creating inheritance in between a function constructor. Let’s say you have … Continue reading How to Create Basic Inheritance in JavaScript Constructors

How to seal, freeze and prevent extension of an object in JavaScript

Read full article on the Infragistics blog In modern JavaScript, objects are integral, and having a strong understanding of topics surrounding objects is necessary for writing better JavaScript. You can create an object in four ways in JavaScript. Read about them in greater detail here. Once you know how to create an object, you may … Continue reading How to seal, freeze and prevent extension of an object in JavaScript

20 JavaScript articles to brush up your JavaScript language

I have been evangelist of JavaScript and Angular for some time now. Below, I am consolidating 20 JavaScript articles written by me. These articles will help you in understanding basic language construct of JavaScript. Topics like objects, hoisting, functions etc. are covered in these articles. Let me know how you find them. 1. How to … Continue reading 20 JavaScript articles to brush up your JavaScript language

How to Count the Number of Properties of the JavaScript Object

While working with JavaScript, I come across a requirement to count a number of properties in a JavaScript object.  I found two ways to find the number of properties in an object. They are as follows: Using for loop Using Object.keys Consider an object, “cat”, as demonstrated below: https://gist.github.com/debugmodedotnet/71a86e81addac19528f75e4591767122 You can find a number of … Continue reading How to Count the Number of Properties of the JavaScript Object