function isNumber
isNumber(object: unknown): object is number
Deprecated
Returns true
if the given object
is a Number
. Otherwise, returns false
.
import util from 'node:util';
util.isNumber(false);
// Returns: false
util.isNumber(Infinity);
// Returns: true
util.isNumber(0);
// Returns: true
util.isNumber(NaN);
// Returns: true
object is number