stack

Home > @infiniteobjects/core-library-web > Arrays

Arrays class

Utilities to interact with Arrays

Signature:

export declare class Arrays 

Methods

Method Modifiers Description
removeItem(item, collection) static Removes the given item from array
shuffle(collection) static Returns a copy of the array with the order of items randomized.
sortBy(collection, iteratee, comparer) static Sorts the array according to a key which is obtained from the array elements. The result is guaranteed to be a stable sort.
uniq(collection) static Creates a duplicate-free version of an array, The order of result values is determined by the order they occur in the array.
uniqBy(collection, iteratee) static This method is like Arrays.uniq except that it accepts iteratee which is invoked for each element in collection to generate the criterion by which uniqueness is computed.