📜  使用数组角度函数返回数组的索引 - Javascript代码示例

📅  最后修改于: 2022-03-11 15:01:13.330000             🧑  作者: Mango

代码示例1
const a = [
{ firstName: "Adam", LastName: "Howard" },
{ firstName: "Ben", LastName: "Skeet" },
{ firstName: "Joseph", LastName: "Skeet" }];

let index = a.findIndex(x => x.LastName === "Skeet");
console.log(index);