es6使用map方法改变数组中某一对象的值
@https://blog.csdn.net/m0_47531829/article/details/124753490
const data = [
{
name: "张三",
age: 12,
_check: true,
},
{
name: "李四",
age: 15,
_check: true,
},
{
name: "王五",
age: 18,
_check: false,
},
];
data.map(item => {
if(item._check) {
item._check = false
}
return item
})
console.log(data,'data');