var setOfCats = {}; //an object
while (r = true) //testing to see if r is true
{
var i = 0;
setOfCats.i = prompt ("What's your cat's name?", ""); //index object elements
alert ("Congratulations! Your cat has been added to the directory.");
var r = confirm ("Would you like to add another cat?"); //if r is true, then the loop should continue. if false, the loop should end.
i++
}
然而,循环并没有结束。在过去的 30 分钟里,我一直在思考这个问题,但徒劳无功。有任何想法吗?