Help for Backwood Brawl (Javascript

Hi guys,

I am trying to utilise an if statement within an if statement, I would like the hero to cleave if ready, but if not to sheild himself and if not to both, then attack.

while(true) {
var enemy = hero.findNearestEnemy();
var distance = hero.distanceTo(enemy);
if (distanc < 5) {
if (hero.isReady(“cleave”)) {
hero.cleave(enemy);
}
else {
hero.shield();

}

}
else {
hero.attack(enemy);
}
}

Typo:
if (distanc < 5) {

Yeah you misspelled that. It should work after you fix that. Also, remember to post your code according to the FAQ.
https://discourse.codecombat.com/faq