3 ms·
> "The parseInt() function parses a string argument and returns an integer" This seems... factually incorrect? Shouldn't it say "a double"? (or a "number", whi
by gorena 11y ago
> "The parseInt() function parses a string argument and returns an integer"
This seems... factually incorrect? Shouldn't it say "a double"? (or a "number", which just means "double" in JS)
It might ignore any characters after a ".", but it's impossible to return an integer in JS...
- chc 11y agoNo, it returns an integer. ECMAScript doesn't officially have a distinct integer type, but the number returned will still be an integer. Incidentally, most JavaScript implementations actually do have an internal integer representation, even though typeof will still just say it's a number.