I’m using the Number js object to get a number from a string.
For example:
Number("123") -> 123
Number(":") -> NaN
but when I’m trying Number(" ")
the result is 0
that’s unclear to me why space output is a 0 and not Nan
Blancer.com Tutorials and projects
Freelance Projects, Design and Programming Tutorials
I’m using the Number js object to get a number from a string.
For example:
Number("123") -> 123
Number(":") -> NaN
but when I’m trying Number(" ")
the result is 0
that’s unclear to me why space output is a 0 and not Nan