任何人都可以帮我解决这个问题:
var questions =[
['how many states?', 1],
['how many continents?', 2],
['how many legs?', 3]
]
var answers = [];
var rightAnswers = [];
var wrongAnswers = [];
for(i = 0; i<questions.length; i+=1){
answers.push(prompt(questions[i][0]).toLowerCase());
if(questions[i][1] === answers[i]){
// rightAnswers.push(questions[i][0])
console.log("success!");
}else{
console.log("bummer");
}
}
比较两个阵列的两个插槽似乎不起作用:( 谢谢!