Aman Kumar has Published 55 Articles

How to get the values of an object in JavaScript?

Aman Kumar

Aman Kumar

Updated on 06-Dec-2022 07:21:21

589 Views

There are some methods for finding the value of an object which is an object.values(), but when you are using this method the process will be lengthy. We can find easily the value of an object with the help of the _.values() function it is a built-in method that belongs ... Read More

How to invert an object in JavaScript?

Aman Kumar

Aman Kumar

Updated on 06-Dec-2022 07:14:59

3K+ Views

Invert means to print the value in reverse order. In a technical word, we can say that suppose we have taken an object of the array. The object takes the value in key-value pairs and prints the value in value-key pairs. The _.invert() function belongs to the underscore.js a javascript ... Read More

How to get the first n values of an array in JavaScript?

Aman Kumar

Aman Kumar

Updated on 06-Dec-2022 07:05:20

1K+ Views

In this article we are going to discuss how to get the first n values of an array using JavaScript. First, n value − to find the elements from the first index to n (n is the given number or given index) suppose you have given the n value as 5 the ... Read More

How do find out all elements that match a specific condition in JavaScript?

Aman Kumar

Aman Kumar

Updated on 06-Dec-2022 06:08:13

1K+ Views

We can find the specific condition with the help of the _.whare() function. The _.where() belongs to underscore.js a javascript library that provides versatile functions. The _.where() is a function used to find the specific element according to the given conditions. Suppose you want to find all the user details ... Read More

How to shuffle an array in a random manner in JavaScript?

Aman Kumar

Aman Kumar

Updated on 06-Dec-2022 06:05:44

442 Views

Shuffle means you are rearranging something from the elements of your array or mixing it to produce a random order. The _.shuffle() belongs to underscore.js a JavaScript library that provides versatile functions. It is used to arrange the list of array elements in a random manner it uses Fisher-Yates shuffle ... Read More

Advertisements