javascript check if array is not null or empty