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
-
theuser47815yReading the manual helps.
"If Type(x) is Number and Type(y) is String,
return the result of the comparison x == ToNumber(y)."
https://ecma-international.org/ecma... -
theuser47815y@melezorus34 That's where you may be wrong good sir. The actual fruit of an apple is the apple core.
-
theuser47815y@melezorus34 Indeed, an Accessory Fruit does not know about seeds so it cannot be a subclass of Fruit, but the instanceOf still works. We have proven that JS is not class oriented then.
-
"is a" is not the same as "equals to".
It looks like your example is just confirming the wrongness of JS. -
Think I get what you're trying to convey, but == is wrong as a comparison operator.
defining, mathematically, how null, 0, "", [], {} and other empty types are exactly empty other than just saying "they just are", is difficult.
Or read this 1980 paper, a foundational work on type theory around implicit conversions in imperative languages: http://cs.cmu.edu/afs/cs/...
Isn't type theory fun?
Anyway, my glass of cognac ∈ ⊥
Wait no, that's impossible, something can't be part of nothing.
Anyway, I'm ∈ drunk people, so my brain is ⊥
Is apple a fruit? Yes.
Is orange a fruit? Yes.
Is apple an orange? No.
Does apple equal a fruit? No.
Does orange equal a fruit? No.
If you're capable of understanding this, then WHY IS IT IT SO DAMN HARD TO UNDERSTAND 0 == ""?
rant