In a Dungeon Arena I decided to help myself with writing some help-functions.
Wrote a small function that helps me to find enemy hero. And it worked just fine before reloading the page.
I hope, I am allowed to post code here, so here it is:
function findKnight(enemies) {
if (enemies.length === 0) return false;
for (var i=0; i<enemies.length, enemies[i].type!='knight' ; i++) {}
return enemies[i];
}
After page reload a warning “Fix your code” appeared, lighting up the “enemies[i].type” string.
It is clear, that this variable may not have such a property, but in that case, what should I do? Create a prototype? )
But “submit” button still works fine