Tell us what’s happening:
Why does my console say underneath the logged text “undefined”? I have checked my code, and I cannot seem to find a reason for this. I am also having trouble with step #4 and 5, since I cannot figure out how to put this into the code without messing something else up.
Your code so far
const lunches = [];
function addLunchToEnd(lunches, str) {
lunches.push(str);
console.log(`${str} added to the end of the lunch menu.`);
}
console.log(addLunchToEnd(lunches, 'Tacos'));
console.log(lunches);
console.log(addLunchToEnd(['Pizza', 'Tacos'], 'Burger'));
console.log(lunches);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36 Edg/149.0.0.0
Challenge Information:
Build a Lunch Picker Program - Build a Lunch Picker Program