Using Set in JavaScript

What is Set in JavaScript? Set lets you store unique object references or primitive values. Let’s start with an example: 1. Using primitive values What we illustrated above is just a simple usecase where we have primitive values and we need those values to be unique, creating a set is the simplest…

Read More

Pure functions

What is a pure function? You can say about a function that is pure when for the same arguments it returns the same result every time. Examples: Pure The function that we will describe below will return the same result for any given 2 numbers. Impure Impure function means that we will not get the…

Read More

Higher order functions in javascript

What is a higher order function in Javascript? A higher order function is a function that can accept another function as argument or it returns another function as a result. Examples: pass a function as a parameter to another function As you can see in the example above we send as arguments to…

Read More

Spread and rest operator(...) in javascript

These in javascript were first introduced in ES2015(ES6) and it allows us to spread and rest multiple elements. Both rest operator and spread operator refer to the same operator. Why and how to use … in javascript and what it does? There are two ways of using the in javascript: Spread operator…

Read More

JavaScript destructuring

Destructuring in javascript is an expression that makes it possible to select values as variables from arrays or objects. How it works? Array destructuring Let’s start with an example: As you can see above will initialize two variables with values 1 and 2 respectively by destructuring that array…

Read More
Page 6 Of 12