Array == script Java de comprimento.

if (typeof array != "undefined" && array != null && array.length != null && array.length > 0) {
    // array exists and is not empty
}
Charming Crossbill