SyntaxFix
Write A Post
Hire A Developer
Questions
Just use Array.length:
Array.length
var arr = []; if (arr.length) console.log('not empty'); else console.log('empty');
See MDN