Im looking to create an empty array that is updated forever via a loop until the user enters "stop". I really cannot figure out how to do it.
var array = [];
while (true) {
array = prompt("Say something?");
if (array) == "stop" {
break;
}
}
You need to change var array = [];
to var array;
,make sure the variable array
is not a array
var array;
while (true) {
array = prompt("Say something?");
if(array == "stop") {
break;
}
}