Професионална програма
Loading...
+ Нов въпрос
krasizorbov avatar krasizorbov 395 Точки

Проблема е тук:

else if (commandLine.includes("Steal")) {
      let [command, count] = commandLine.split(" ");
      count = Number(count);
      let stolen = [];
      if (count < initialChest.length) {
        stolen = initialChest.splice(initialChest.length - count);
        console.log(stolen.join(", "));
      } else {
        stolen = initialChest.splice(0, initialChest.length);
        console.log(stolen.join(", "));
      }
    }

Така ще работи!

0
16/09/2020 18:08:10