Reputation: 139
Such as the Title Description
In JavaScript, what is the difference between var a=5. and var a=5?
typeof(5.) //return number
typeof(5) //return number
Upvotes: 1
Views: 765
Reputation: 85575
In javascript floating point numbers are also considered as number so typeof(5.)
is equal to typeof(5.0)
which returns number.
Upvotes: 8