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
-
Seethe4609y@devitalizer actually I find it more disturbing that if sad evaluates to true, the first line in the function should fail...
-
@Seethe but that line might actually work in case sad is an instance of class that extends Boolean class (if there is one in js), but anyway, comparing it's address to true is dumb
-
Seethe4609y@devitalizer there isn't an object in JavaScript that works that way. The result of sad() could be exactly equal to true, or sad() could return a truthy statement, in which case the condition would fail. The problem is evaluating sad() cannot both be exactly equal to true, and an object. This could however be written:
if(sad() === true) {
sad.stop();
beAwesome();
} -
Seethe4609yAlthough that is of course assuming that the language is JavaScript and not one of MANY languages that use dot resolution syntax.
Related Rants
The motto 😏
undefined
programming
motto