I need to solve The Hunt Begins - Javascript Help!

function averageSize(burls) {
var sum = sumSize(burls);
return sum / burls.length;
}

function sumSize(burls) {
var sum = 0;
var enemies = hero.findByType("burl");
for (var i = 0; i < enemies.length; i++) {
var enemy = enemies[i];
sum = sum + enemy.size;
}
return sum;
}

while(true) {
var burls = hero.findEnemies();
averageSize(burls);
hero.say("The average size of the seen burls " + averageSize(burls));
}

Why doesn’t my code work?

Just say a number without the text.

1 Like

ty…

You need a var to receive the sumsize