13 conclusion


#1

var drinks = ["Coke", "Water", "Sprite", "Beer"];

for (i = 4; i > drinks.length; i++){
console.log(drinks[i]);
}
var userChoice = prompt("What you like to drink?");{

console.log(userChoice);

}
if (userChoice = "Coke" ){
console.log("You like to drink a " + drinks[0]+"");
}

else if (userChoice = "Water" ){
console.log("You like to drink a " + drinks[1]+"");
}

else if (userChoice = "Sprite" ){
console.log("You like to drink a " + drinks[2]+"");
}

else if (userChoice = "Beer"){
console.log("You like to drink a " + drinks[3]+"");
}

else{
    console.log("We don't have that.");
};



Whats wrong i chose beer and it gives me coke?


#2

Hi here

if (userChoice = "Coke")

Try ti put === instead of =

Do it also for the else if statement