This is first time when variable name isn’t a:

let baseball_bat = 0;

baseball_bat += 0==[[[[[[]]]]]] // BONK! baseball_bat = 1

Explanation

Comparing 0 to this… array return 1. Let’s figure it out step-by-step:

  • In the beginning we are trying to compare Number with Object. You can find how it works in specification. Array will be casted with ToPrimitive() operation and return "".
    • Result will be same for [], [[]], [[[]]], etc.
  • In result, we have "" == 0. Now we visit specification again and find out that we need transform string with ToNumber() operation, and it will return 0.
  • 0 == 0 will return true. In the end, adding true is similar to adding 1 (still not the best idea).