DEV Community

Discussion on: How to check if Number is Float in JS

Collapse
 
jmitchell38488 profile image
Justin Mitchell • Edited

This doesn't validate if the specific type is a float. In fact, JS has no concept of floats, it only has the singular concept of number, so what you're really testing here is if the value is an whole number (int) or a decimal (double).

All JS numbers are doubles; 64 bit double precision floating point numbers.