EasyConceptJavaScript internals
What does typeof null return and why?
What a good answer covers
It returns 'object', a historical bug in the language that was kept for compatibility. Check for null explicitly with value === null.
PreviousWrite unit tests for a form component with React Testing Library.Next What is the difference between null and undefined?
More on JavaScript internals
Flashcards for this topic- EasyWhat is the difference between null and undefined?
- MediumWhat is the event loop and how are microtasks and macrotasks ordered?
- MediumWhat is the output order of a setTimeout of 0, a resolved promise then and synchronous code?
- MediumHow does this work in regular functions, arrow functions and with bind?