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

Advertisements

What are getters and setters in JavaScript

In JavaScript, you may have heard of getters and setters. Let’s take a look at what these things are.First, a setter is used to set the value of a property. A setter gets called each time the value of the property is changed. In other words, it executes a function for each time a property … Continue reading What are getters and setters 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 in … Continue reading Simplifying function hoisting in JavaScript