Level/lurkers javascript, what wrong with my code?


#1

var enemies = this.findEnemies();
var enemyIndex = 0;
while (enemyIndex < enemies.length) {
var enemy = enemies[enemyIndex];
if (enemy.type == ‘shaman’) {
while (enemy.health > 0) {
this.attack(enemy);
enemyIndex++;
}
}
}