Summary Quick Revision use strict In JavaScript, “use strict” is a directive introduced in ECMAScript 5 (ES5) that enables Strict Mode, a restricted variant of JavaScript. ClosuresA closure is a function that retains access [ … ]
Tag: js interview question
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 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 [ … ]
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
Sort Array of Objects by Property Value in JavaScript
In this article I will discuss about how to sort array of objects by property or key value. Consider the following array of objects: Suppose you want to sort the [ … ]
Important JavaScript Array Methods
In this article I will discuss about some of the important inbuilt array methods in JavaScript. I will cover the following methods: length, concat, sort, reverse, split, join, push, pop, [ … ]
