{
  "id": 18797578,
  "title": "Yes, [] == ![] Is True. No, JavaScript Isn't Broken (I Checked, Slowly).",
  "url": "https://urgent.news/2026/11/07/yes-is-true-no-javascript-isnt-broken-i-checked-slowly",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-07T22:00:00.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/aheadkit/yes-is-true-no-javascript-isnt-broken-i-checked-slowly-5fa0"
  },
  "original_language": "en",
  "account": "JavaScript does not appear to be broken when it returns true for the line console.log([] == ![]);. The confusion arises from understanding the logic behind the comparison. An empty array [] is considered truthy in JavaScript, so the exclamation point (!) converts it to false. Thus, the line is essentially asking if [] is equal to false. When comparing different types (array and boolean), JavaScript quietly converts them before comparison. The boolean false converts to the number 0, and an empty array [] converts to an empty string, which in turn converts to 0. Therefore, the comparison reduces to 0 == 0, which is true.\n\nTo avoid this confusion, it is recommended to use the triple equals operator (===) instead of the double equals (==). The triple equals operator does not perform any type conversions and immediately returns false if the types are different, thus eliminating any unexpected results.\n\nOne interesting example to try is console.log(0 == false);. The boolean false converts to 0, so the comparison becomes 0 == 0, which is true. This demonstrates the importance of understanding JavaScript's type conversion rules to predict the outcome of such comparisons accurately.",
  "summary": "Is JavaScript gaslighting me, or is there a logic to this? I hit this line at about 1 a.m., laptop on a pillow, one eye open. I read the result, read it again, and seriously considered that the language was making fun of me personally. This post takes that single line apart, one tiny piece at a time, until it stops being magic and starts being almost boring. That is a promise: boring is what we…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}