JavaScript Object Property Descriptors

In JavaScript, you can create an object literal as shown in the listing below:At first sight, it looks like the object cat has two properties with a string and number value. However, it’s much more than that to a JavaScript interpreter. In ES5, the concept of a Property Descriptor was introduced. Before we go aheadContinueContinue reading “JavaScript Object Property Descriptors”

Simplifying Content Projection in Angular

In Angular, content projection is used to project content in a component. Let’s take a closer look at how it works:Content projection allows you to insert a shadow DOM in your component. To put it simply, if you want to insert HTML elements or other components in a component, then you do that using conceptContinueContinue reading “Simplifying Content Projection in Angular”

Arrow functions in JavaScript

The JavaScript arrow function is a shorter way of writing a function expression that was introduced in ECMAScript 6. Usually in JavaScript, you can create a function in two ways:Function as statement Function as expressionA function statement can be created as shown below:The same function can be created as a function expression as shown below:ECMAContinueContinue reading “Arrow functions in JavaScript”

Simplifying function hoisting in JavaScript

To understand function hoisting, let us start by considering the code listed below:In any other programming language, the output here would be a reference error. However, in JavaScript you will get undefined as the output. Why? Because JavaScript hoists variables at the top of the execution context. An execution context could be the function inContinueContinue reading “Simplifying function hoisting in JavaScript”

What is the arguments object in a JavaScript function?

A JavaScript function has array-like objects called arguments which correspond to the arguments passed to the function. All arguments passed to a JavaScript function can be referred using the arguments object.  Now as we get started, let’s consider the code listed here:In the above function, num1 and num2 are two arguments.  You can refer toContinueContinue reading “What is the arguments object in a JavaScript function?”

What is a Default Parameter in a JavaScript function?

A JavaScript function can have default parameters values. Using default function parameters, you can initialize formal parameters with default values. If you do not initialize a parameter with some value, then the default value of the parameter is undefined. While calling function foo, you are not passing any parameter, so the default value of variableContinueContinue reading “What is a Default Parameter in a JavaScript function?”

What is the Rest Parameter in a Function?

Learn full article on Infragistics blog A JavaScript function can take any number of parameters. Unlike other languages like C# and Java, you can pass any number of parameters while calling a JavaScript function. JavaScript functions allows unknown number of function parameters. Before ECMAScript 6, JavaScript had arguments variable to access these unknown or variableContinueContinue reading “What is the Rest Parameter in a Function?”

What is “let” statement in JavaScript?

Using the let statement, you can create Block scoped local variables in JavaScript. The let statement was introduced in the ECMAScript 6 standard of JavaScript. Before ECMAScript 6, JavaScript had three types of scoping: Global scoping Functional scoping Lexical scoping To explore let statement in detail, consider the code snippet given below: https://gist.github.com/debugmodedotnet/d7bb15f004965cb03ff532e19680195f You willContinueContinue reading “What is “let” statement in JavaScript?”

Join free webinar on “Step by Step Getting Started with Angular 4”

On behalf of Infragistics , I am hosting a free webinar on “Step by Step Getting Started with Angular 4”. To attend register here . I invite you to attend this webinar on 20 July 2017 Thursday at 11 AM. This is an opportunity for you to learn Angular 4 application development from comfort ofContinueContinue reading “Join free webinar on “Step by Step Getting Started with Angular 4””