Jika array kosong

var arrayName = [];

if (arrayName.length === 0) {
    // Your code
}
Blushing Baboon