Workshop › Memory › Step 6 of 25
Under the cards there are 8 fruits, each twice. SYMBOLS lists the 8 fruits, and newGame builds the 16 cards by
putting the list twice into one array.
```js
const SYMBOLS = ['🍎', '🍌', '🍇', '🍒', '🥝', '🍋', '🍉', '🍑']
let cards
function newGame() {
cards = [...SYMBOLS, ...SYMBOLS]
}
newGame()
```[ ... ] is an array: a list in order. Emoji are text, so they are in quotes....SYMBOLS spreads the list's items into the new array; twice gives 16 items.function newGame() { ... } defines the recipe; newGame() at the bottom runs it.TOP, write SYMBOLS, then let cards and newGame with empty lines between them.newGame().Skills: Arrays and objects, Functions
← Four rows Cards that know themselves →