//数组
let a =[
{b:1},
{b:2}
]
let num = 1
let fx = a.findIndex( item =>{
return item.b == num
})
console.log(fx);
//返回找到的第一个找到的索引
//如果找不到返回-1
01-19
11-17
761
05-18
2万+
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交