ensureCapacity Method

  • If the capacity (Float64Array length) is less than or equal to the requested newCapacity, do nothing.
  • If the requested newCapacity is larger than the existing capacity, reallocate to larger capacity, and copy existing values.

ensureCapacity(newCapacity: number, applyGrowthFactor: boolean = true): void

Parameter Type Description
newCapacity number size of new array
applyGrowthFactor boolean whether to apply the growth factor to newCapacity when reallocating

Returns - void

Defined in

Last Updated: 16 April, 2024