GitHub 6219★

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);
Follow me on and to get more useful contents.