help with exercise 2 in JS Assignment 10: Array Properties and Methods
HannahB593 (1)

I'm really stuck on this question- the rest i understand and have correctly. Just not sure what's wrong with two.

This is what I have:

function exerciseTwo(snacks){
let favoriteSnack= 'grapes';
snacks.push = (favoriteSnack (or grapes?) ;
return snacks;
}

before i added "let favoriteSnack" i had gotten the error saying "grapes is undefined."- so that's why i tried to use that. been looking for clues but unsure- can anyone help ?

You are viewing a single comment. View All
HannahB593 (1)

excellent! This worked, thank you. That makes sense considering unshift has 1 in exercise 4 for example, which is just in parentheses just like 'grapes' is in this exercise. @Highwayman