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

Simplifying function expressions and the function statement in JavaScript

Read full article on the Infragistics blog In JavaScript, a function can be created in three possible ways: Function as an expression Function as a statement Arrow functions In this post, we will learn about function expressions and the function statement. Consider the following code: https://gist.github.com/debugmodedotnet/e4b1dc967bc51b6c8dd1ff98d8d88dc6 When you create a function as shown above, it…… Continue reading Simplifying function expressions and the function statement in JavaScript

What are the Call and Apply Methods in JavaScript

Read full article on the Infragistics blog In JavaScript, the apply() and call() methods execute a function in the context (scope) of the first argument you pass to them. Let’s take a look at them in action to learn more. Say that you have an object person as shown below: https://gist.github.com/debugmodedotnet/11ca4e8d58e602ca93813cef93d9601e And in addition, you have a…… Continue reading What are the Call and Apply Methods in JavaScript

Four Ways to Create Objects in JavaScript

In JavaScript, there are four methods to use to create an object: Object literals New operator or constructor Object.create method Class In this post, we will learn each of these methods. Object literals An object literal, also called an object initializer, is a comma-separated set of paired names and values. You can create an object…… Continue reading Four Ways to Create Objects in JavaScript

What are Template Literals in JavaScript

Read full article on the Infragistics blog In ES6, two types of literals were introduced: Template Literals for string concatenation and expression embedding in a string Tagged Template Literals to tag the Template Literal in a function so the literal can be evaluated in the function Let’s assume that you need to do the string…… Continue reading What are Template Literals in JavaScript

Simplifying function expressions and the function statement

Read full article on the Infragistics blog In JavaScript, a function can be created in three possible ways: Function as an expression Function as a statement Arrow functions In this post, we will learn about function expressions and the function statement. Consider the following code: https://gist.github.com/debugmodedotnet/f7f9c0a6e18a62521ad5fd6656adb69e When you create a function as shown above, it…… Continue reading Simplifying function expressions and the function statement