Build a Shopping List - Step 5

Tell us what’s happening:

Hello, I’m stuck here, what am I doing wrong? Thanks!

Your code so far

console.log("Grocery shopping list");

const shoppingList = [];

console.log("It will be nice to have some fruit to eat.");

shoppingList.push("Apples");


// User Editable Region

function getShoppingListMsg(shoppingList){
  return `"Current Shopping List: + ${shoppingList}"`

}

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36

Challenge Information:

Build a Shopping List - Step 5

the quotes and the + are not to be part of the final string

You can use template literals or string concatenation with the + operator, not both at the same time

function getShoppingListMsg([shoppingList])
{
  return `Current Shopping List: + ${shoppingList}`

}

Thanks but still not working…

check what your function is returning

also you may want to change the function parameter, remove the square brackets

1 Like