javascript if array length greater than 0