0.41.3 • Published 1 year ago

@util.js/arrays v0.41.3

Weekly downloads
1
License
MIT
Repository
github
Last release
1 year ago

@util.js/arrays

JavaScript utility methods for arrays

@util.js/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.41.3

1 year ago

0.41.2

1 year ago

0.41.1

2 years ago

0.41.0

3 years ago

0.40.0

3 years ago

0.40.1

3 years ago

0.39.2

5 years ago

0.39.1

5 years ago

0.39.0

5 years ago

0.38.0

5 years ago

0.37.1

5 years ago

0.37.0

5 years ago

0.36.1

5 years ago

0.36.0

5 years ago

0.35.0

5 years ago

0.34.0

5 years ago

0.33.1

5 years ago

0.33.0

5 years ago

0.32.0

5 years ago

0.31.0

5 years ago

0.30.0

5 years ago

0.29.1

5 years ago