Build a Shopping List - Step 5

Tell us what’s happening:

I used the following function but when i test the code it tells me that it shoould return a string. whats the issue here? tried concation, template literals all the same problem.

const getShoppingListMsg = function(arr = ) {
return Current Shopping List: ${arr};
};

Your code so far


// User Editable Region

const getShoppingListMsg = function(arr = []) {
  return `Current Shopping List: ${arr}`;
};

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:144.0) Gecko/20100101 Firefox/144.0

Challenge Information:

Build a Shopping List - Step 5

Hi @JFA2000 and welcome to our community!

Your solution works from my end. Please try one of the following steps to move forward.

Click on the “Restart Step” button and force a refresh of your page with CTRL + F5 then try to paste the code in again.

or - Try the step in incognito or private mode.

or - Disable any/all extensions that interface with the freeCodeCamp website (such as Dark Mode, Ad Blockers, or Spellcheckers), and set your browser zoom level to 100%. Both of these factors can cause tests to fail erroneously.

or - Ensure your browser is up-to-date or try a different browser.

I hope one of these will work for you.