StrictArray

StrictArray

A strict array that only accepts one type of element

Constructor

# new StrictArray(acceptedTypes)

Creates a strict array that only accepts one type of element

Parameters:
NameTypeDescription
acceptedTypesstring

The type of element that the array should accept

Since:
  • v2.4.0

Extends

  • Array

Methods

# push(…el) → {array}

Push a value to the array

Parameters:
NameTypeAttributesDescription
el*<repeatable>

The value to push to the array

Returns:

Returns the array

Type
array

# unshift(…el) → {array}

Push a value to the front of the array

Parameters:
NameTypeAttributesDescription
el*<repeatable>

The value to push to the array

Returns:

Returns the array

Type
array