lessThan()

Checks whether the primitive value of a child class is less than the given value

Inequality.prototype.lessThan()

Checks whether the primitive value of a child class instance is less than the given value.

inequality.class.ts
public lessThan(value: number): boolean {
  return this.#less.than(value);
}

Parameters

value:number

A rest parameter of the numbers to test.

Return type

Returns

The return value is a boolean indicating whether the primitive value of a child class instance is less than the given value.

Example usage

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

// Define the `Year` class and extend it with `Inequality`.
class Year<Value extends number> extends Inequality<Value> {}

// Initialize `Year`.
const year = new Year(1981);

// Returns Year {1981} of Year<1981>.
year;

// Returns `true`. 1981 < 1982.
year.lessThan(1982);

// Returns `false`. 1981 < 1980.
year.lessThan(1980);

Last updated