Javascript
Javascript
Remove duplicate values in an array
This function removes duplicate values from an array. JavaScript: TypeScript:
Javascript
Repeat an array
This function repeats the elements of an array a given number of times. JavaScript: TypeScript:
Javascript
Remove falsy values from array
This function removes all ‘falsy’ values (false, null, 0, ”, undefined, and NaN) from an array. JavaScript: TypeScript:
Javascript
Split an array into chunks
This function splits an array into chunks of a specified size. JavaScript: TypeScript:
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:
Recent comments