All Articles

Find the maximum item of an array

This function finds the largest number in an array. JavaScript: TypeScript:

Get indices of a value in an array

This function returns all the indices of a specified value in an array. JavaScript: TypeScript:

Find the index of the minimum item of an array

This function finds the index of the smallest number in an array. JavaScript: TypeScript:

Find the length of the longest string in an array

This function finds the length of the longest string in an array. JavaScript: TypeScript:

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:

Find the index of the maximum item of an array

This function finds the index of the largest number in an array. JavaScript: TypeScript:

Find the minimum item of an array

This function finds the smallest number in an array. JavaScript: TypeScript:

Flatten an array

This function flattens an array, meaning it removes one level of nesting. JavaScript: TypeScript:

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.…

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: