check null and array length javascript code example
Example: array==null array.length java script
if (typeof array != "undefined" && array != null && array.length != null && array.length > 0) {
// array exists and is not empty
}
if (typeof array != "undefined" && array != null && array.length != null && array.length > 0) {
// array exists and is not empty
}