Consider the following code snippet:
document.getElementById("value").textContent = ![]
<h1 id="value"></h1>
Why is []
not falsy in JavaScript? You would think that []
would be falsy and !falsy
would be true. Why is this not the case?
Blancer.com Tutorials and projects
Freelance Projects, Design and Programming Tutorials
Consider the following code snippet:
document.getElementById("value").textContent = ![]
<h1 id="value"></h1>
Why is []
not falsy in JavaScript? You would think that []
would be falsy and !falsy
would be true. Why is this not the case?