I need help (yes another time)

hi im back with my questions so
this is the code

function makeShoppingList(item1 = 'milk', item2='bread', item3='eggs'){
  console.log(`Remember to buy ${item1}`);
  console.log(`Remember to buy ${item2}`);
  console.log(`Remember to buy ${item3}`);
}

makeShoppingList()

it works perfect but when i change the makeShoppingList() to makeShoppingList('pasta')

it only change the item1 .
i ried couple of ways like =
makeShoppingList('pasta, sugar ,salt ')
or
makeShoppingList('pasta' + 'sugar' + 'salt ')
but it only change the item 1
how can i change the other items ?

(hi since you are a problem solver i think you can solve my problem @mtf)

If you want to overwrite the default values,

makeShoppingList('pasta', 'sugar', 'salt')
2 Likes

it worked , thanks
you are a true problem solver

1 Like

If you have Chrome, in the location bar, type, about:blank and Enter. That will give you a blank browser window. Now bookmark it and save it to the bookmarks bar. Right-lick the bookmark and Open in a new window, then go and close the other browser window.

This gives you a working console off to the side to turn to anytime you wish to test some code. Keep it open while you are working and close or refresh to clear the workspace.

Working tip: Since all I do is small stuff that is sure to have mistakes, I do not use const or let to declare variables else one cannot go back and correct the error without refreshing and losing all the code. You’ll get the picture in due course.

2 Likes

thanks for the tipp but im using firefox
much better when i can customize it myself with css

1 Like