📜  js 插入数组 - Javascript 代码示例

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

代码示例6
var select =[2,5,8];
var filerdata=[];
for (var i = 0; i < select.length; i++) {
  filerdata.push(this.state.data.find((record) => record.id == select[i]));
}
//I have a data which is object,
//find method return me the filter data which are objects
//now with the push method I can make array of objects