I wrote a function that behaves differently depending on the numeric type of it\'s parameters. Integer or float.
Using some code from this question How do I check that a
You've acknowledged that JavaScript only has a single Number type. As such, 1 is identical to 1.0.
Number
1
1.0
If you need this for display purposes, then you should use toFixed.
toFixed
1..toFixed(1); // "1.0"
number%1===0
If that condition is true , it's integer, else it's float
true