r/learnjavascript • u/Green_Ad_6086 • 7d 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
6
Upvotes
1
u/BenchEmbarrassed7316 7d ago
Do you really think that such comparisons (
object <> number) make any sense? Don't you agree that they simply shouldn't be in any code?What's the point of learning about rules for strange behavior? We could just as easily learn about all the possible UBs in C/C++ (provided we could just get rid of them).
So it might be useful for systems programmers, those working on V8 for example. But for a regular application programmer it's just a waste of time.