var multiAnswer = this.multiAnswer; //this.multiAnswer为一个数组 var answer = this.answer; //this.answer为一个数组 for(var i=0;i<multiAnswer.length;i++){ if(multiAnswer.indexOf(i) != answer[i]){ //判断multiAnswer数组上的第i个跟answer数组的第i个是否相等
//不相等时执行
return; }else{ //相等时执行
}
}
至此,两个数组是否相等就可以得到答案