Help with level/arcane-ally

Hi,
I am stuck in - level/arcane-ally. here is my code. but this is failing and the code in the help section is the same.
i am able to kill the 1st ogre, but get killed by the second ogre. My health level is 61 on the board. why is my code failing.

// Take down those ogres!
loop {
var enemy = this.findNearestEnemy();
if (enemy) {
this.attack(enemy);
}

}

Thanks

thanks guys. i switched swords and the code worked.

thanks