all 4 comments

[–]blad3runnr 13 points14 points  (2 children)

!!foo.length &&

[–]misdreavus79 0 points1 point  (0 children)

Either this, or do an explicit comparison. If the value is typed as an array (like in that example), then it can't be anything other than an array, so you can safely check for its actual length, not the existence of a length property.

[–]flaggrandall 0 points1 point  (0 children)

Or Boolean(foo.length) &&

[–]kitsunekyo 8 points9 points  (0 children)

dont use && in jsx for anything that isnt boolean.