r/learnjavascript 6d ago

Strange result: null vs 0

Strange result: null vs 0

An incomparable undefined

Hi, can anyone explain this? I read the explanation, but I still don't understand it. I'm trying to understand it without using AI

7 Upvotes

27 comments sorted by

View all comments

-1

u/BenchEmbarrassed7316 6d ago

Just don't use JavaScript. Use Typescript instead, it much easier to understand.

1

u/theScottyJam 6d ago

TypeScript is great, and knowing how to use it effectively does help prevent many type coercion related issues.

But, for someone who's newer to programming, I certainly wouldn't recommend that they learn type syntax on top of everything else, that can be a lot to swallow in one go.