js基础 数组findIndex

 

 

var le = [{name:"js"},
         {name:"css"},
                    {name:"python"}
         ];

var index = le.findIndex(function(item){
  return item.name== "css";
});
console.log(index);

1

 

posted @ 2021-02-28 13:42  AngDH  阅读(261)  评论(0编辑  收藏  举报