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.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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.