275
Grizzly
8y

Difference between 0 and NULL.

Comments
  • 9
    This should be used as the prime example when learning the difference..
  • 4
    Just for the sake of asking... In the moment of most need, what would you prefer to have of those 2? 0 or null?
  • 4
    Also works for null vs undefined
  • 3
    @jchw undefined is the button on the right.
    You can try grab a toilet paper of an empty roll.
    You can put an empty roll where the is none.
    And if the system has reached an undefined status, you probably don't want to hang a toilet paper in there.

    Or am I missing something here?
  • 2
    Except in C/C++ 😬
  • 0
    And remember:
    null == 0 is true
    null === 0 is false
Add Comment