Javascript
Javascript
Zip multiple arrays
This function ‘zips’ multiple arrays, merging them into one array of tuples, where the first element of each input array…
Javascript
Get the unique values of an array
This function removes all duplicate values from an array. JavaScript: TypeScript:
Javascript
Swap two array items
This function swaps two items in an array based on their indices. JavaScript: TypeScript:
Javascript
Get the sum of an array of numbers
This function calculates the sum of all the numbers in an array. JavaScript: TypeScript:
Javascript
Get union of arrays
This function returns an array that contains all unique elements of two or more arrays. JavaScript: TypeScript:
Javascript
Group an array of objects by a key
This function groups an array of objects by a certain key. JavaScript: TypeScript:
Javascript
Find the minimum item of an array
This function finds the smallest number in an array. JavaScript: TypeScript:
Javascript
Flatten an array
This function flattens an array, meaning it removes one level of nesting. JavaScript: TypeScript:
Javascript
Get all arrays of consecutive elements
This function returns an array of arrays, each of which contains a series of consecutive numbers from the original array.…
Javascript
Find the closest number from an array
This function finds the number in an array that is closest to a given target number. JavaScript: TypeScript: