Hey Schuster, there's no harm with sharing information. 😄 Thanks for reading, I hope this was informative. I was not sure if I should point it in this article as this is not entirely related to prototype inheritance - (and I hate to be that guy as well 😅) null is not an Object. It is a separate primitive in JavaScript. The reason why typeof null returns Object is a legacy bug in JavaScript which can't be fixed. More on this - 2ality.com/2013/10/typeof-null.html
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.
Hey Schuster, there's no harm with sharing information. 😄 Thanks for reading, I hope this was informative. I was not sure if I should point it in this article as this is not entirely related to prototype inheritance - (and I hate to be that guy as well 😅)
null
is not anObject
. It is a separate primitive in JavaScript. The reason whytypeof null
returnsObject
is a legacy bug in JavaScript which can't be fixed. More on this - 2ality.com/2013/10/typeof-null.html