这可能是重复的,但我忍不住发布了这个,我有一个这种格式的数组
answerCollection= {
0:
{selected : a,
status : false
},
1:
{selected : a,
status : false
}
}
我想像这样对这个数组进行索引检查
if(answerCollection.indexOf(indexNo) == -1){
sel = "a";
}
但它一直失败,即我一直得到-1的返回值,无论索引是否存在于数组中。
我该如何进行这种搜索?