Considering JavaScript's type coercion, what will be the result of [] == ![]?

  • TRUE
  • FALSE
  • undefined
  • Throws an error
JavaScript performs type coercion when comparing values. In this case, the empty array [] is truthy, and ![] evaluates to false. When comparing, the empty array is coerced to false, resulting in true. This behavior can be surprising and is a common gotcha in JavaScript.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *