javascript check if array is null or undefined or empty