Mayank Agarwal has Published 403 Articles

How do closures work in JavaScript?

Mayank Agarwal

Mayank Agarwal

Updated on 27-Jun-2022 06:47:54

In this article, we are going to learn about ‘closure’ and how they actually work in JavaScript. The closure is basically a combination of a function that is enclosed with the references to its surrounding state (Also known as the lexical environment).In JavaScript, closures are basically created every time a ... Read More

How to use the debugger keyword in JavaScript?

Mayank Agarwal

Mayank Agarwal

Updated on 28-Apr-2022 14:31:01

Whenever an unexpected occurrence takes place in a JavaScript code, we need to debug it to check the cause. Debugging is a very important aspect of programming that lets you determine why a system or application behaves abnormally. It is a process of testing multiple times with different inputs and ... Read More

What is WeakSet Object in JavaScript?

Mayank Agarwal

Mayank Agarwal

Updated on 28-Apr-2022 14:27:52

In this article, we are going to explore WeakSet objects and how to use them in JavaScript. The JavaScript WeakSet object is a type of collection that allows the user to store items that are held loosely only.WeakSet is just a collection of items that do not include any arbitrary values.It ... Read More

How to use setTimeout() function in JavaScript?

Mayank Agarwal

Mayank Agarwal

Updated on 28-Apr-2022 14:22:15

The setTimeout() function is provided by the window object, which calls the specified JavaScript function after the specified time only. This function will be called just once after waiting for the timeout set by the user.It is similar to an alarm or reminder functionality. In the same way, we set ... Read More

What is Strict Mode in JavaScript and How to Enable It?

Mayank Agarwal

Mayank Agarwal

Updated on 28-Apr-2022 14:11:39

The Strict mode was introduced in ECMAScript 5 in JavaScript. It is a mechanism to opt into a restricted version of JavaScript. Strict mode modifies the regular JavaScript semantics. Some JavaScript silent errors are eliminated by converting them into throwing errors in Strict mode.How to enable strict mode in JavaScriptWe ... Read More

What is Math Object in JavaScript Program?

Mayank Agarwal

Mayank Agarwal

Updated on 28-Apr-2022 14:03:36

Math is an inbuilt object provided by JavaScript that has multiple attributes and methods for different mathematical functions and constants. This is not a function object.Maths objects generally work with the Number type.The Math object does not have a constructor and all the properties and methods are fixed or static.The ... Read More

What is the currying function in JavaScript?

Mayank Agarwal

Mayank Agarwal

Updated on 28-Apr-2022 13:56:33

Currying is a technique in functional programming that performs the transformation of a function with multiple arguments into several functions containing a single argument in a sequence.The translation of a function happens something like thisfunction dummy(param1, param2, param3, .....) { }is converted into -function curriedFunction(param1) {    return function (param2) ... Read More

What is a typical use case for JavaScript anonymous functions?

Mayank Agarwal

Mayank Agarwal

Updated on 28-Apr-2022 13:48:59

In this article, we are going to explore the Anonymous functions in JavaScript and also learn about their use cases. An anonymous function is a special type of function that does not have any name associated with it.In JavaScript, we normally use the function () keyword before defining any function ... Read More

What are the Pros and Cons of JavaScript Frameworks?

Mayank Agarwal

Mayank Agarwal

Updated on 28-Apr-2022 13:43:36

JavaScript has become the most widely used language in the field of web development in a relatively short span of time. For the last 25 years, the JavaScript frameworks have been driving web developmentIn this article, we are going to elaborate upon the uses of JavaScript frameworks along with their ... Read More

What are the Important Array Methods in JavaScript?

Mayank Agarwal

Mayank Agarwal

Updated on 28-Apr-2022 13:35:58

In this article, we are going to explore different methods provided by Array and their importance in JavaScript. We will learn how to use them and what are their actual use cases with the help of examples.Before moving on to methods, below is the syntax for creating an array in ... Read More

1 2 3 4 5 ... 41 Next
Advertisements