🇧
Size: a a a
🇧
L
t
🇧
🇧
🇧
L
DE
function calculateAverageCountryPopulation(countries) {
// write code here
var total = 0;
var l = countries.length;
for(var i = 0; i < l; i += 1) {
total += countries[i].population;
}
return total / l;
}
DE
const calculateAverageCountryPopulation = (countries) => countries.reduce((acc, { population }) => acc + population, 0) / countries.length
ПО
DE