Open mjsarfatti opened 4 years ago
On the type checking section the following is recommended to see if a variable is an object:
typeof variable === "object"
The problem is that:
typeof null === "object"
So the recommendation should probably read:
typeof variable === "object" && variable !== null
Though, some coders will prefer to shorten that to,
typeof variable === "object" && variable
(That works because, if variable is an object, only null will test false.)
null
false
On the type checking section the following is recommended to see if a variable is an object:
The problem is that:
So the recommendation should probably read: