@touratica/array-utils
v1.1.0
Published
A npm package that adds functionality to the JavaScript built-in Array object.
Downloads
1
Readme
array-utils
A npm package that adds extra functionality to the JavaScript built-in Array object. The new functions are:
Array.copy(Array<T>)
Array.deepCopy(Array<T>)
Array.shallowCopy(Array<T>)
Array.shuffle(Array<T>)
.shuffle()
Array.copy(Array<T>)
Alias for Array.deepCopy
.
Array.deepCopy(Array<T>)
Receives an array and returns an array with the same values.
Array.shallowCopy(Array<T>)
Receives an array and returns an array with the same values. Not suitable for objects or multidimensional arrays.
Array.shuffle(Array<T>)
Receives an array and returns a new array with same values shuffled.
.shuffle()
Shuffles an array in-place and returns the same array.