Hacker News new | ask | show | jobs
by nijiko 4554 days ago
if (array && !array.length) { /* do something here */ }

Check existence as well, this also works for a jQuery selection.