// filter(callbackFn)

const stus = [
    { name: '张三', score: 59 },
    { name: '老钟', score: 95 },
    { name: 'SB', score: 80 }
];

// 筛选所有 score >= 60 的信息
const rst = stus.filter(item => { return item.score >= 60 })
console.log(rst)

// 浅表拷贝，rst[0]的修改，会导致stus中对应数据的修改
rst[0].score = 100
console.log(stus)

/*
# node filter.js 
[ { name: '老钟', score: 95 }, { name: 'SB', score: 80 } ]
[
  { name: '张三', score: 59 },
  { name: '老钟', score: 100 },
  { name: 'SB', score: 80 }
]
*/
