Files
bitburner-src/src/utils/helpers/isValidNumber.ts
T

8 lines
216 B
TypeScript

/**
* Checks that a variable is a valid number. A valid number
* must be a "number" type and cannot be NaN
*/
export function isValidNumber(n: number): boolean {
return (typeof n === "number") && !isNaN(n);
}