3.You’re in a hurry so you decide to ask a friend to help you with your grocery shopping. You want him to pick up the bananas, coffee beans, and brown rice.
Use .slice() to provide him with a list of these three things.
Log this part of the list to the console. Unlike the two previous checkpoints, you should do both of these steps in one line.
Not really sure what It wanted me to do here. How doesnt the slice syntax operate? How am I supposed to do that all in one line?
let groceryList = ['orange juice', 'bananas', 'coffee beans', 'brown rice', 'pasta', 'coconut oil', 'plantains']; groceryList.shift(); // Q1 groceryList.unshift('popcorn'); //Q2 console.log(groceryList.slice()); // not sure what it wants me to do here
Its probably simpler than I’m imagining but I took a look at the hint and it raised more questions for me than it answered:
Not sure what the arguments in the brackets are getting at. ‘first’ and ‘last+1’ doesn’t make much sense to me. Can someone enlighten me to what I’m missing here?