break out of for of loop javascript