I’m a frontend developer who constantly aims to improve my skills. I have done some little projects, but I’m carrying on creating new ones. I really want to complete this course to deepen my language knowledge and be better.
function getAverageAge(list) {
if (list.length === 0) return 0
if (list.length === 1) return list[0].age
return Math.round(list.map(el => el.age).reduce((a, b) => a + b)/list.length)
}