Alright I’m just curious when I’m coding and using } } } } all the time at the end, is there a way I can summarize all the } ?
ie) What’s highlighted bold
while(true) {
var enemy = hero.findNearestEnemy();
if(enemy) {
// Find the distance to the enemy with distanceTo.
var dte = hero.distanceTo(enemy);
// If the distance is less than 5 meters…
if (dte < 5) {
// … if “cleave” is ready, cleave!
if (hero.isReady(“cleave”)) {
hero.cleave(enemy);
// ... else, just attack.
} else {
if(enemy) {
hero.attack(enemy);
**}**
} <<All
} <<Of
} <<This
} <<?