Skip to content

greaterThan ​

The greaterThan() method checks whether a number is strictly greater (>) than a given threshold. It can be used in a curried way to ease functional composition.

Interactive example ​

Syntax ​

Classic signature ​

typescript
function greaterThan<
	GenericInput extends number
>(
	input: GenericInput,
	threshold: number
): boolean

Curried signature ​

typescript
function greaterThan<
	GenericInput extends number
>(
	threshold: number
): (input: GenericInput) => boolean

Parameters ​

  • input: The number to compare (classic signature only).
  • threshold: The comparison threshold.

Return value ​

returns true if the value is strictly greater than the threshold, false otherwise.

See also ​

  • greater - Checks whether a number is greater than or equal (>=)
  • less - Checks whether a number is less than or equal (<=)
  • lessThan - Checks whether a number is strictly less (<)

Sources ​

Released under the MIT license.