javascript check array length greater than 0