javascript break out of for each loop