ArrayUtils

ArrayUtils

Utilities for arrays and typed arrays

Constructor

new ArrayUtils()

Methods

(static) find(array, predicate) → {*}

Returns the first element in the supplied array for which the supplied predicate is true

Parameters:
Name Type Description
array
predicate

(static) fromKeys(collection) → {Array}

Returns an array of keys for the given Set or Map

Parameters:
Name Type Description
collection Set | Map

(static) fromValues(collection) → {Array}

Returns an array of values for the given Set or Map

Parameters:
Name Type Description
collection Set | Map

(static) getTypedArray(arrayBuffer, pointer)

Create a typed array view on an ArrayBuffer, using the supplied pointer. Notice that this
does not copy any elements, if you make changes to the returned array, the original
ArrayBuffer will be modified.

Parameters:
Name Type Description
arrayBuffer ArrayBuffer
pointer Array

Array [start, length, format] where start is the start byte offset
in the buffer, length is the number of values of the given format, and format is a string
denoting the data format:
'float32' creates a Float32Array
'uint32'
'uint16'
'uint8'

(static) isShallowEqual(a, b) → {boolean}

Uses === to compare the elements of two arrays.

Parameters:
Name Type Description
a Array

An array to compare.

b Array

An array to compare.