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;
}
}
2
Answers
You need to change
var array = [];
tovar array;
,make sure the variablearray
is not a arrayif
is incorrect