check row empty array javascript

JavaScript
if(array && array.length){   
   // not empty 
} else {
   // empty
}
Source

Also in JavaScript: