javascript if array is not null or empty