Javascript
Javascript
Sort an array of items by given key
This function sorts an array of objects based on a given key. JavaScript: TypeScript:
Javascript
Swap the rows and columns of a matrix
This function swaps the rows and columns of a 2D array, also known as ‘transposing’ a matrix. JavaScript: TypeScript:
Javascript
Get all subsets of an array
This function generates all possible subsets of an array. JavaScript: TypeScript:
Javascript
Sort an array of numbers
This function sorts an array of numbers in ascending order. JavaScript: TypeScript:
Javascript
Get the rank of an array of numbers
This function returns an array with the same length as the input array, where each element is the rank of…
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
Find the length of the longest string in an array
This function finds the length of the longest string in an array. JavaScript: TypeScript:
Javascript
Find the minimum item of an array by given key
This function finds the smallest number in an array of objects, based on a specified key. JavaScript: TypeScript:
Javascript
Find the index of the maximum item of an array
This function finds the index of the largest number in an array. JavaScript: TypeScript:
Javascript
Find the maximum item of an array by given key
This function finds the largest number in an array of objects, based on a specified key. JavaScript: TypeScript: