JavaScript 循环关卡攻略: while 与 for 怎么选

循环攻略

森林战役的巡逻兵关卡, 用 while 站桩输出更稳。

while (hero.distanceTo(enemy) > 5) {
  hero.shield();
}