Exercism-JS/elyses-destructured-enchantments/HINTS.md
2022-05-12 03:01:05 -05:00

1.9 KiB

Hints

1. Get the first card

  • This article has a good overview of array destructuring. You can find an example of basic variable assignment in the 'Basic Array Destructuring' section.

2. Get the second card

  • You can use placeholders to ignore one or more values in the array.
  • You can find an example here.

3. Swap the first two cards

  • It's possible to swap two values in a single destructuring expression.
  • You can find an example here.

4. Discard the top card

  • There is a built-in operator that can be used to collect the remaining values in an array into a single variable.
  • You can find an example here.

5. Insert face cards

  • There is a built-in operator that can be used to expand an array into a list.
  • You can find a more detailed overview here.