let students = Array.from(Array(50), function(_, i){
return {
'学号': i > 9 ? `${i + 1}` : `0${i + 1}`,
// '语文': Math.round(Math.random() * 60 + 40),
'语文': Math.round(Math.random() * 100),
'数学': Math.round(Math.random() * 100)
}
})
// console.log(students)
let arr = students.map(function(item){
// console.log(item['语文'] + item['数学'])
return item['语文'] + item['数学']
})
let max = Math.max(...arr)
console.log(`最高成绩是${max}分`)
let first = students.filter(function(item){
return item['语文'] + item['数学'] === max
})
// console.log('成绩第一的是')
console.log(first)
console