Javascript
Javascript
Unzip an array of arrays
This function ‘unzips’ an array of tuples into multiple arrays, reversing the ‘zip’ operation. JavaScript: TypeScript:
Javascript
Cast a value as an array
This function checks if a value is already an array, and if not, it wraps the value in an array.…
Javascript
Check if an array is empty
This function checks whether an array is empty. JavaScript: TypeScript:
Javascript
Clone an array
This function clones an array, creating a new array with the same elements. JavaScript: TypeScript:
Javascript
Compare two sets
This function compares two sets for equality, regardless of the order of elements. JavaScript: TypeScript:
Javascript
Find the maximum item of a set
This function returns the maximum value from a set. JavaScript: TypeScript:
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
Shuffle an array
This function shuffles the elements of an array. 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:
Recent comments