⚠ toArray()

Returns a read-only array of the range in order minimum and maximum

Range.prototype.toArray()

Deprecated: This feature is no longer recommended. Avoid using it, and update existing code if possible. Be aware that this feature may cease to work at any time.

The toArray() method returns a read-only array of the range in order minimum and maximum.

range.class.ts
public toArray(): readonly [Min, Max] {
  return [this.#minimum.valueOf(), this.#maximum.valueOf()];
}

Return type

Type

The return type

Returns

The return value is a read-only array of the range in order minimum and maximum.

Example usage

// Example usage.
import { Range } from '@angular-package/range';

// Create new instance.
const range = new Range(4, 27);

// Returns [4, 27] of type readonly [4, 27]
range.toArray();

Last updated