面试题答案
一键面试function getFirstScores(...arr) {
return arr.reduce((acc, {scores = []}) => {
if (scores.length > 0) {
acc.push(scores[0]);
}
return acc;
}, []);
}
function getFirstScores(...arr) {
return arr.reduce((acc, {scores = []}) => {
if (scores.length > 0) {
acc.push(scores[0]);
}
return acc;
}, []);
}