Answer the question
In order to leave comments, you need to log in
2 conditions are set, but only one is displayed, what did I do wrong?
let nickname = "TestName";
let balance = 7000;
if (nickname === "admin") {
console.log("Администратор");
} else if(nickname === "") {
console.log("Гость");
} else if (balance > 1000) {
console.log("Постоянный покупатель");
} else if (balance > 5000) {
console.log("ВИП-клиент");
}
Answer the question
In order to leave comments, you need to log in
Probably it needs to
let nickname = "TestName";
let balance = 7000;
if (nickname === "admin") {
console.log("Администратор");
} else if(nickname === "") {
console.log("Гость");
} else if (balance >= 1000 && balance < 5000) {
console.log("Постоянный покупатель");
} else if (balance >= 5000) {
console.log("ВИП-клиент");
}
who first got up - that and slippers
The condition "more than 1000" is fulfilled, and does not go further, there else (otherwise)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question