Skip to main content

isNumber

function isNumber
Jump to headingisNumber(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

Parameters Jump to heading

Jump to headingobject: unknown

Return Type Jump to heading

object is number
Back to top