Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Dacexi120368yNaN is signaling that something should be a number but isn't. Therefore it has the type number as that's what it represents.
-
saiphp11798yNot a Number but it is itself a number to compare that's something is not a number haha
-
Bikonja23868yOne of my previous rants was about isNaN(null) and isNaN(undefined) not giving the same value which makes less sense than this because you could say that the type of NaN is a number because it is used to represent an expected number where an invalid value for a number was given. But I have no idea why typeof(null) would be true unless numbers were considered nullable types which doesn't really make sense as that's the purpose of NaN...
-
We all know that js is a horrible mess that still allows you to write beautiful code if avoiding all the possible landmines, so I've been thinking, why not make a subscript of js with all the wide-recognised bad parts cut out? What do you guys think about that? I'm hugely underskilled to pull that off myself though 😥
-
@jallman112 yeah, that book is exactly why I know about the existence of such parts :P
-
arekxv10548yI still don't understand why these things bother people so much.
1. These are results of implicit conversions which should force people to understand how that language really does these things.
2. Saying a language is bad because of this is weird, since every language has its quirks when doing implicit things and there is not really much anyone can do about it. People will just have to understand the language they are using a bit better :) -
@arekxv well if there are whole books literally saying that many parts of it are horrible, then it's not strange to see people telling it's horrible given that most of them will not care enough to learn it and get to the good parts? And (no offence) saying "you just don't know this language" is no excuse, because if a language doesn't makes sense, then most probably it's badly designed.
-
@trnktms hahaha I think this only make sense for "Latin derived" languages speakers
Related Rants
The type of NaN looks like a paradox
undefined
type
js
paradox
nan