0.29.0 • Published 5 years ago

utiljs-arrays v0.29.0

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

utiljs-arrays

JavaScript utility methods for arrays

utiljs-arrays is part of Util.js.

This class contains all the non-instance methods of Array in addition to:

Arrays API

Kind: global class
Access: public

arrays.from(arrayLike, mapFn, thisArg) ⇒ Array

Creates a new, shallow-copied Array instance from an array-like or iterable object.

See MDN's documentation about from.

Kind: instance method of Arrays
Returns: Array - A new Array instance
Access: public

ParamTypeDescription
arrayLikeAn array-like or iterable object to convert to an array
mapFnfunctionMap function to call on every element of the array
thisArgObjectValue to use as this when executing mapFn

arrays.isArray(obj) ⇒ boolean

Determines whether the passed value is an Array.

See MDN's documentation about isArray.

Kind: instance method of Arrays
Returns: boolean - true if the object is an Array or false otherwise
Access: public

ParamTypeDescription
obj*The object to be checked

arrays.of(...elementN) ⇒ Array

Creates a new Array instance with a variable number of arguments, regardless of number or type of the arguments

See MDN's documentation about of.

Kind: instance method of Arrays
Returns: Array - A new Array instance
Access: public

ParamTypeDescription
...elementN*Elements of which to create the array

arrays.shuffle(array) ⇒ Array

Shuffles the elements of the specified array.

See knuth-shuffle.

Kind: instance method of Arrays
Returns: Array - A new Array instance
Access: public

ParamTypeDescription
arrayArrayThe array to shuffle
0.29.0

5 years ago

0.28.1

5 years ago

0.24.0

6 years ago

0.23.0

6 years ago

0.22.0

6 years ago

0.21.0

6 years ago

0.19.0

6 years ago

0.18.0

6 years ago

0.12.0

6 years ago

0.9.0

6 years ago

0.8.0

6 years ago

0.6.0

6 years ago

0.5.0

6 years ago

0.4.0

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago

0.0.0

6 years ago