Javascript

Find the maximum item of a set

This function returns the maximum value from a set. JavaScript: TypeScript:

Find the minimum item of a set

This function returns the minimum value from a set. JavaScript: TypeScript:

Remove an item from a set

This function removes an item from a set. JavaScript: TypeScript:

Create a set from an array

This function creates a set from an array. The set contains all unique elements of the array. JavaScript: TypeScript:

Convert a set to an array

This function converts a set to an array. JavaScript: TypeScript:

Check if a set is a subset of another set

This function checks whether the first set is a subset of the second set. JavaScript: TypeScript:

Find the intersection of two sets

This function finds the intersection of two sets, i.e., elements that are common to both sets. JavaScript: TypeScript:

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:

Get all subsets of an array

This function generates all possible subsets of an array. JavaScript: TypeScript:

Sort an array of numbers

This function sorts an array of numbers in ascending order. JavaScript: TypeScript: