scrimba
Introduction to ES6+
Spread Operator (Challenge)
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

To see this lesson you need to be logged in. Joining Scrimba is free and gives you access to 20+ courses.Sign up
Spread Operator (Challenge)
AboutCommentsNotes
Spread Operator (Challenge)
Expand for more info
index.js
run
preview
console
/*
**** Challenge ****

Imagine you are going out to do some grocery shopping.
So you have an array called shoppingList with all the products you want to buy.

Now that you are inside of the shop, you have a basket with all the products from your list, but you want to add a few more.

Create a new array called shoppingBasket, that will be a copy of the shoppingList array, and add some new products into it.

*/

const shoppingList = ["eggs", "milk", "butter"];
Console
/index.html
-1:54