(x % 3 === 0 && x % 5 === 0) {
console.log("JuliaJames");
} else if (x % 3 === 0) {
console.log("Julia");
} else if (x % 5 === 0) {
console.log("James");
} else {
console.log(x);
}
x = x + 1;
}
The loop exits as soon as the condition is met, and does not further checks other conditions?
use continue;
Обсуждают сегодня