this post was submitted on 18 Jul 2023
746 points (93.2% liked)

Programmer Humor

37254 readers
33 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 6 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] jedibob5@lemmy.world 5 points 2 years ago* (last edited 2 years ago)

It does some funky things with type coercion and comparison which I don't particularly like, but I generally understand why it does things that way.

A lot of the weird quirks of JS come from the desire to avoid completely blowing up and crashing as much as possible, which makes sense in a web dev context. Forcing weird operations to at least return something can prevent an unhandled error state in a single component from causing an entire page to crash, even if that component ends up malfunctioning as a result.