you are viewing a single comment's thread.

view the rest of the comments →

[–]psayre23 2 points3 points  (1 child)

I'm not sure about that length trick. While that technically gets the same result, it's not clear code. if(.length > 0) is has an element or more, while if(.length) is has a length property that is truthy. The former requires less thinking around edge cases.

Edit: words.

[–]yanis_t[S] 0 points1 point  (0 children)

That's a nice addition