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

Understanding ViewEncapsulation in Angular

To understand ViewEncapsulation in Angular, first we should understand about Shadow DOM.  You can learn in detail about Shadow DOM here. Putting it in simple words, Shadow DOM brings Encapsulation in HTML Elements. Using the Shadow DOM , markup, styles, and behaviors are scoped to the element and do not clash with other nodes of the DOM. Shadow DOM is part of … Continue reading Understanding ViewEncapsulation in Angular

Understating Angular Change Detection with example

Change Detection means updating the DOM whenever data is changed. Angular provides two strategies for Change Detection. Default strategy onPush strategy In default strategy, whenever any data is mutated or changed, Angular will run change detector to update the DOM. In onPush strategy, Angular will only run change detector only when new reference is passed … Continue reading Understating Angular Change Detection with example

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