-
-
Notifications
You must be signed in to change notification settings - Fork 0
number negative integer
Nicholas Berlette edited this page Jun 19, 2025
·
1 revision
function isNegativeInteger<N = number>(it: N): it is NegativeInteger<N>;Checks if a given value is a negative integer.
| Name | Info |
|---|---|
it |
The value to check. |
true if the value is a negative integer, false otherwise.
Numbers
import { isNegativeInteger } from "jsr:@nick/is/integer";
console.log(isNegativeInteger(0)); // false
console.log(isNegativeInteger(1)); // false
console.log(isNegativeInteger(-1)); // true
console.log(isNegativeInteger(1.5)); // false
console.log(isNegativeInteger(NaN)); // false
console.log(isNegativeInteger(Infinity)); // falsefunction isNegativeInteger(it: unknown): it is NegativeInteger<number>;Checks if a given value is a negative integer.
| Name | Info |
|---|---|
it |
The value to check. |
true if the value is a negative integer, false otherwise.
Numbers
import { isNegativeInteger } from "jsr:@nick/is/integer";
console.log(isNegativeInteger(0)); // false
console.log(isNegativeInteger(1)); // false
console.log(isNegativeInteger(-1)); // true
console.log(isNegativeInteger(1.5)); // false
console.log(isNegativeInteger(NaN)); // false
console.log(isNegativeInteger(Infinity)); // falseexport type NegativeInteger<N = number> = Cast<N, NEGATIVE & INTEGER>;Casts a value into a negative integer type. If the value is not a number, it
will resolve to never.
-
N(default:number)
Numbers