@noelle idk `![]` being false seems expected to me, and `false + false` being 0 makes more sense than it being anything else, so the only part of this which i think might be objectionable is the fact that `[] + $` is a string
@noelle that’s definitely weird behaviour, but it falls out of the fact that strings and numbers are the only valid outputs of an addition operation, and having `[] + $` be a number is almost definitely worse
@Lady I figured you might respond. ;) Yeah, it's all expected behavior given the structure of the language, but the structure of the language makes me want to bop its designer with a rolled-up newspaper. :)
@noelle what makes this especially scary is that this is equivalent to "[]True"[2]
like, what??
@Lady Yeah, not [] being equivalent to True is weird.
@noelle i mean i get it but it is indicative of a fundamentally different understanding of []
in JS, [] is just a special kind of object, and all objects are truthy
Python doesn’t take the same “everything is an object™” approach so you wind up with more exceptional cases like that
@noelle which is why personally i don’t like Python (because i find the “everything is an object” approach to be much simpler to reason about than whatever it is Python does) but i understand how for other people, the incredibly ambiguous mess which is JavaScript would be bothersome lol
@noelle anyway i think the reason why javascript gets a weird reputation isn’t because it lets you do weird typecasting things but because it lets you do weird typecasting things in very very few characters 😝
@noelle yep you can’t add symbols