var
data=[
{key:'1',title:'a',parentId:'-1'},
{key:'2',title:'b',parentId:'-1'},
{key:'3',title:'c',parentId:'-1'},
]
// data.splice(1,1)删除
//插入 data.splice(1,0,{key:'2',title:'b',parentId:'-1'}) ;
//查找 var r= data.findIndex(item => item.key ==='2');
//查找 var r= data.filter (item => item.key ==='2');
es6 数组插入删除查找过滤
最新推荐文章于 2022-06-24 09:44:17 发布