× {{alert.msg}} Never ask again
Get notified about new tutorials RECEIVE NEW TUTORIALS

JavaScript Weirdness - typeof [] === typeof {} evaluates to 'true'

Asad Saeeduddin
Oct 08, 2015
<p><code>typeof</code> returns the primitive type of the operand. For anything other than bools, numbers, strings, functions, and undefined, this is object.</p> <p>This tip was originally posted on <a href="http://stackoverflow.com/questions/30020073/JavaScript%20Weirdness%20-%20typeof%20%5B%5D%20===%20typeof%20%7B%7D%20evaluates%20to%20'true'/30020096">Stack Overflow</a>.</p>
comments powered by Disqus