thanEvery()

Checks whether the primitive value of a specified object is less than every value of the given values

Less.prototype.thanEvery()

Checks whether the primitive value of a specified object is less than every value of the given values.

less.class.ts
public thanEvery(...values: number[]): boolean {
  return Array.isArray(values)
    ? values.every((value) => this.valueOf() < value)
    : false;
}

Parameters

...values:number[]

A rest parameter of the numbers to test.

Return type

Returns

The return value is a boolean indicating whether the primitive value is less than every value of the given values.

Example usage

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

// Define constant `id`.
const id = 390;

// Returns `false`.
new Less(id).thanEvery(387, 388, 390);

// Returns `true`.
new Less(id).thanEvery(393, 392, 394, 391);

Last updated