Loading...

Category: JavaScript

What is Closure in JavaScript

In this article I will explain closure – one of the important concepts in JavaScript. I will also cover the benefits of using closures. What is a closure? JavaScript is [ … ]

What is Hoisting and Temporal Dead Zone in ES6

Hoisting is important JavaScript concept introduced in ECMAScript 6 (ES6) where variables and function declarations (declared using var) are moved to the top of their scope before code execution. Inevitably, [ … ]

What is DOM

The Document Object Model (DOM) is a tree representation of a document on the web. It consists of objects representing logical structure of a document and the content in it. The objects [ … ]

What is Promise in JavaScript

A Promise is an object that represents the eventual completion (or failure) of an asynchronous operation, and its resulting value. Promise can either be fulfilled with a value, or rejected with a reason (error). A [ … ]

Handling Array of Objects in JavaScript

If you are working with APIs, most of the time you will encounter arrays of objects. In this article you will learn how array of objects should be handled for [ … ]

What is async/await in JavaScript

The async/await is a new feature included in ECMAScript 2017 or ES8 JavaScript edition in order to make asynchronous function calls easier and it act as syntactical sugar on top [ … ]

What is Callback in JavaScript

A callback is a plain JavaScript function passed to some other function as an argument or option. In JavaScript, functions are objects. Because of this, a function can take another function as a [ … ]

Remove Duplicates From Array in JavaScript

Here is a simple way to remove duplicate elements from an array in JavaScript. Just loop through the actual array and push each element in another temporary unique array. Before [ … ]

Trim All Whitespaces From String in JavaScript

JavaScript’s inbuilt method trim() removes whitespace from both ends of a string. The Syntax: str.trim() The method returns new string representing the str stripped of whitespace from both ends. Try yourself

What is New in ES6

ES (ECMAScript) is the official name of JavaScript. ES6 was released in June 2015, which is stated as the sixth edition of the language. It is also known as ECMAScript [ … ]