3 ms·
> At the moment I don't even feel like I can write a protocol that expected implementations to distinguish `1` and `1.0`. Indeed you can't, among other reasons
by inimino 10y ago
> At the moment I don't even feel like I can write a protocol that expected implementations to distinguish `1` and `1.0`.
Indeed you can't, among other reasons because that distinction doesn't exist in JavaScript, but ... why would you want to make such a subtle distinction?
If you really want what you described above, you can get it by using a string.
- seagreen 10y agoI respect the pragmatism of your reply. At the same time "distinguish decimals and integers" is about as far from a subtle distinction as you can get.
- inimino 10y agoThe distinction may be familiar to us, but if you ask someone on the street, "1" and "1.0" are the same number. The habit we have of giving them different types is somewhat arbitrary.