@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 Fair enough. :)
@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 😝
@Lady ...also probably fair! :)
@noelle “every operator should return a result without throwing an error” is definitely A Choice and they sure made it
@noelle (strictly speaking javascript operators can throw errors if .valueOf() or .toString() also throw errors or ultimately fail to produce primitives, but that’s not the case for any builtin thing i don’t think. maybe some of the newer ones? i’d have to check)
@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