mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.5 KiB
43 lines
1.5 KiB
4 years ago
|
## 🌟 Rest in peace
|
||
|
|
||
|
### Notions
|
||
|
|
||
|
- [devdocs.io/operators/spread_syntax](https://devdocs.io/javascript/operators/spread_syntax)
|
||
|
|
||
|
### Instructions
|
||
|
|
||
|
The battle is won! The Army of the Dead have finally fulfilled their oath. It is
|
||
|
now time to free them so that they may rest in peace.
|
||
|
|
||
|
But first we need to regroup and count them to make sure not one single soul is
|
||
|
left behind. We will provide a four variables of type array:
|
||
|
|
||
|
- `swordMen`
|
||
|
- `archers`
|
||
|
- `captains`
|
||
|
- `generals`
|
||
|
|
||
|
You will need to concat the content of `swordMen` and `archers` into one array
|
||
|
`footSoldiers`. That batallion is lead by `'Grim the Terrible'`. He likes to
|
||
|
scream to soldiers that walks too slow, so you need to put him as the last
|
||
|
element of the array.
|
||
|
|
||
|
Then you will do the same for `captains` and `generals` into the array
|
||
|
`horseMen`. That batallion is lead by `'The Skull Knight'`. He, on the other
|
||
|
hand, likes to lead from the front. He needs to be the first element of the
|
||
|
array.
|
||
|
|
||
|
Finally you will do it one more time for `footSoldiers` and `horseMen` into the
|
||
|
array `armyOfTheDead`. For having a better overview, `'The King of the Dead'`
|
||
|
needs to be tactically positioned in between his foot soldiers and his knights.
|
||
|
|
||
|
Oh! and here is a little detail, the methods `concat`, `push` and `unshift` were
|
||
|
damaged during the battle... so find another way.
|
||
|
|
||
|
Hurry, they are waiting...
|
||
|
|
||
|
> Well, this is a thing unheard of. \
|
||
|
> An Elf would go underground, where a Dwarf dare not. \
|
||
|
> Oh, I'd never hear the end of it.! \
|
||
|
> ― Gimli
|