Branded numeric type for integers. Represents values that pass Number.isInteger(x) check.
Number.isInteger(x)
const isInt = (x: number): x is Int => Number.isInteger(x);const getArrayElement = <T>(arr: readonly T[], index: Int & NonNegativeNumber) => arr[index];const factorial = (n: Int & NonNegativeNumber): Int => n === 0 ? 1 as Int : (n * factorial((n - 1) as Int & NonNegativeNumber)) as Int; Copy
const isInt = (x: number): x is Int => Number.isInteger(x);const getArrayElement = <T>(arr: readonly T[], index: Int & NonNegativeNumber) => arr[index];const factorial = (n: Int & NonNegativeNumber): Int => n === 0 ? 1 as Int : (n * factorial((n - 1) as Int & NonNegativeNumber)) as Int;
Branded numeric type for integers. Represents values that pass
Number.isInteger(x)check.