May be a long argument but it's not two nulls, it's a null (defined) and an undefined. They have usefully different meanings and usages. Saying it's two nulls is a bit like saying that zero and null are the same because they both mean "nothing".
I would have to agree with you, however in the wild most code I've seen misinterprets this and there is mixed usage of both all over the place..
And everybody is true here :)
I try to use undefined as much as I can instead of null.
undefined
null
But some frameworks want you to use null.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
May be a long argument but it's not two nulls, it's a null (defined) and an undefined. They have usefully different meanings and usages. Saying it's two nulls is a bit like saying that zero and null are the same because they both mean "nothing".
I would have to agree with you, however in the wild most code I've seen misinterprets this and there is mixed usage of both all over the place..
And everybody is true here :)
I try to use
undefined
as much as I can instead ofnull
.But some frameworks want you to use
null
.