javascript can you break out of foreach