Having trouble with this array. am I starting it wrong?
DeShawnKeller (0)

function exerciseTwo(snacks){
// Exercise Two: you will be given an array called 'snacks'
// Using an array method, add your favorite snack to the end of the array
function exerciseTwo(snacks){
var snacksArray = ["chips", "popcorn", "ice cream"];
snacksArray.push('oreo');

}

You are viewing a single comment. View All
vedprad1 (815)

You have two problems:
1. You said function exerciseTwo(snacks){ two times. You should only have it once.
2. You created a variable snacksArray. However, you weren't supposed to. You were supposed to use the already given array called snacks.

The final product would look like this:

function exerciseTwo(snacks) {
  snacks.push('oreos');
}
DeShawnKeller (0)

I have tried that still fail my quiz. I have tried to put double ("") also. @vedprad1

vedprad1 (815)

@DeShawnKeller : Why don't you try adding return snacks; at the end?
But I don't think you need to.

vedprad1 (815)

@DeShawnKeller : Could you please mark my answer as correct? Thanks!