no, it says there is no such enemy . . . which is different.
“if enemies” means “are there any enemies” NOT “does the one I’m targeting exists.”
enemies(enemies.length) never exists. you are saying attack the nth enemy of a 0 through (n-1) array of enemies.
So OK, I guess in a quite real sense it IS saying that the electrocute is not wrapped in an if enemy . . . . and it is Correct.
1+2) you are saying: if there exist enemies, then attack the one AFTER the last one on the list…
Your electrocute should probably be using “enemy” just like “if enemy attack(enemy)” (unless you really mean attack some “random” guy who just happens to be at the end of the list of enemies, in which case it should be (length - 1))
I would say this is one of the weirdest debugging problems ever invented . . . . the student/person (you) knows EXACTLY what the problem is and yet you can’t see that you are completely correct.
('tis actually, a well known phenomenon and the reason why you shouldn’t proof-read your own papers/etc)