Aman Kumar has Published 44 Articles

How to invert an object in JavaScript?

Aman Kumar

Aman Kumar

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

2K+ 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

909 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

974 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

347 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