Wait. Hold on.
Let me try to explain you this.
In the beginning, where you have auto friends = hero.findFriends(); it means that you call the hero.findFriends()
array with one word: friends.
After for
, you have auto friend = friends[i]
, or it could be hero.findFriends()[i]
, which gives you one friend, not an array. And after this, you command one friend to attack the enemy.
1 Like