I am new to working in js so that my code is not working
my code is:
let output = document.getElementById("output");
let addfruit;
let fruitList = [];
let howManyTimes = prompt("how many fruit to want to add?");
for (let index = 0; index < howManyTimes.length; index++) {
addfruit = prompt("enter fruits name");
if (addfruit == "no") {
break;
}
fruitList.push(addfruit);
}
for (myShop of fruitList) {
output.innerHTML += myShop + "<br/>";
}
my problem is that there is when I want 5 times prompt then I will get only 1 prompt
any help thanks.