We're a place where coders share, stay up-to-date and grow their careers.
I think telling null is an object is confusing. Null is a primitive value and the only reason it pretends to be an object is a bug.
yes, it is just the return value of typeof(null), an old well known bug. Thanks for noticing it Logan, I will see if it can be said in a better way
That link helps, thank you!
I think you'd both find this conversation interesting. Sinder makes some valid points for eradicating null even if some native APIs return null.
null
Sindre Sorhus @sindresorhus @bitandbang As for the "why", see github.com/sindresorhus/m… 18:06 PM - 29 Mar 2020 0 5
It's highly unlikely that null will be leaving the language, but regardless, there are still interesting convos in that GitHub issue.
I think telling null is an object is confusing. Null is a primitive value and the only reason it pretends to be an object is a bug.
yes, it is just the return value of typeof(null), an old well known bug. Thanks for noticing it Logan, I will see if it can be said in a better way
That link helps, thank you!
I think you'd both find this conversation interesting. Sinder makes some valid points for eradicating
null
even if some native APIs returnnull
.It's highly unlikely that
null
will be leaving the language, but regardless, there are still interesting convos in that GitHub issue.