AmitDiwan has Published 11365 Articles

How does Promise.any() method differs from Promise.race() method in JavaScript?

AmitDiwan

AmitDiwan

Updated on 16-Feb-2023 13:52:21

56 Views

In this article, you will understand how Promise.any() method differs from Promise.race() method in JavaScript. The Promise.any() method in javascript is one among promise concurrency methods. It is useful when the first task needs to be completed. The Promise.race() method in javascript is one among promise concurrency methods. It is ... Read More

How Check if object value exists not add a new object to array using JavaScript ?

AmitDiwan

AmitDiwan

Updated on 16-Feb-2023 12:47:37

1K+ Views

In this article, you will understand how to check if the object value exists, if not, add a new object to the array using JavaScript. In Javascript, almost every variable is an object. An object can be a string, numbers, boolean values, etc. They can also be key-value pairs. An ... Read More

How does Implicit coercion differ from Explicit coercion in JavaScript?

AmitDiwan

AmitDiwan

Updated on 16-Feb-2023 12:46:53

1K+ Views

In this article, you will understand how implicit coercion differs from Explicit coercion in JavaScript. An implicit coercion is an automatic conversion of values from one datatype to another. It is also known as type conversion. An explicit coercion is the conversion of data type depending on the user's necessity. ... Read More

How does internationalization work in JavaScript?

AmitDiwan

AmitDiwan

Updated on 16-Feb-2023 12:45:33

200 Views

In this article, you will understand how internationalization works in JavaScript. Internationalization is the process of preparing software so that it can support local languages and cultural settings. It can include changing the date and time format, changing the metric system format, language format, etc. Example 1 In this example, ... Read More

How does Promise.all() method differs from Promise.allSettled() method in JavaScript?

AmitDiwan

AmitDiwan

Updated on 16-Feb-2023 12:44:54

109 Views

In this article, you will understand how does Promise.all() method differs from the Promise.allSettled() method in JavaScript. The Promise.all() method takes in one or multiple promises as input and returns a single Promise. This returned promise fulfills when all of the input's promises are fulfilled. It rejects a promise when ... Read More

How does inline JavaScript work with HTML?

AmitDiwan

AmitDiwan

Updated on 16-Feb-2023 12:30:02

5K+ Views

In this article, you will understand how inline JavaScript works with HTML. Inline JavaScript represents a code block written in between the tags in a html file. The advantage of using inline JavaScript in HTML files is to reduce the round trip of the web browser to the server. ... Read More

How to remove falsy values from an array in JavaScript?

AmitDiwan

AmitDiwan

Updated on 16-Feb-2023 12:23:09

484 Views

In this article, you will understand how to remove false values from an array in JavaScript. An array in JavaScript is a special variable that can hold more than one item. An array can be initialized using the keyword ‘const’ .Falsy values are nothing but boolean false values. Example 1 ... Read More

How to call the key of an object but return it as a method, not a string in JavaScript?

AmitDiwan

AmitDiwan

Updated on 16-Feb-2023 12:19:40

562 Views

We can use the "Object.keys()" method to retrieve the keys of an object. However, instead of returning the keys as a string, we can wrap the call to "Object.keys()" in a function. This way, when we call the function, it will return the keys as a method, rather than ... Read More

How to call the loading function with React useEffect?

AmitDiwan

AmitDiwan

Updated on 16-Feb-2023 12:14:36

12K+ Views

We will use the React useEffect hook to call our loading function. This hook allows us to specify a function that will run on a specific component lifecycle event, such as when the component mounts. By passing in our loading function as a dependency, we ensure that it will be ... Read More

How to call a function from its name stored in a string using JavaScript?

AmitDiwan

AmitDiwan

Updated on 16-Feb-2023 12:12:39

8K+ Views

We will use the eval() function to call a function from its name stored in a string. The eval() function evaluates a string as JavaScript code. This allows us to call the function by passing the string containing its name as an argument to the eval() function. Example Here ... Read More

Advertisements