javascript check if array is empty or null or undefined