[Home] >  Validator >  Check if a value is a number

Check if a value is a number

JavaScript version

const isNumber = (value) => !isNaN(parseFloat(value)) && isFinite(value);

TypeScript version

const isNumber = (value: any): number => !isNaN(parseFloat(value)) && isFinite(value);