isNumber - Node documentation
function isNumber

Usage in Deno

import { isNumber } from "node:util";
isNumber(object: unknown): object is number
Deprecated

Since v4.0.0 - Use typeof value === 'number' instead.

Returns true if the given object is a Number. Otherwise, returns false.

const util = require('node:util');

util.isNumber(false);
// Returns: false
util.isNumber(Infinity);
// Returns: true
util.isNumber(0);
// Returns: true
util.isNumber(NaN);
// Returns: true

Parameters

object: unknown

Return Type

object is number