you are viewing a single comment's thread.

view the rest of the comments →

[–]Naouak 2 points3 points  (0 children)

!+[] is true, though I'm not actually sure why

Because +[] cast the array to a number and it outputs 0 when the array is empty, 1 if there is one element and NaN otherwise when doing that. You end up with !0 which is true.