# Build a Lunch Picker Program - Build a Lunch Picker Program

**URL:** <https://forum.freecodecamp.org/t/build-a-lunch-picker-program-build-a-lunch-picker-program/756121>\
**Category:** I Built This\
**Created:** [July 24, 2025, 11:03am UTC](https://forum.freecodecamp.org/t/build-a-lunch-picker-program-build-a-lunch-picker-program/756121 "2025-07-24T11:03:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pure53178](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/pure53178/32/392722_2.png) [@pure53178](https://forum.freecodecamp.org/u/pure53178)\
**Post date:** [July 24, 2025, 11:03am UTC](https://forum.freecodecamp.org/t/build-a-lunch-picker-program-build-a-lunch-picker-program/756121/1 "2025-07-24T11:03:01Z")

</div>

### Tell us what’s happening:

I passed all steps Is there anything I should improve or fix?

### Your code so far

```js
let lunches = [];
let lunchItem = "";

function addLunchToEnd(lunches, lunchItem) {
  lunches.push(lunchItem);
  console.log(`${lunchItem} added to the end of the lunch menu.`);
  return lunches;
}
addLunchToEnd(lunches, "Tacos");

function addLunchToStart(lunches, lunchItem) {
  lunches.unshift(lunchItem);
  console.log(`${lunchItem} added to the start of the lunch menu.`);
  return lunches;
}
addLunchToStart(lunches, "Sushi");

function removeLastLunch(lunches) {
  if(lunches.length === 0) {
    console.log("No lunches to remove.");
  } else {
    const removedItemLast = lunches.pop();
    console.log(`${removedItemLast} removed from the end of the lunch menu.`);
  }
  return lunches;
}
removeLastLunch(["Stew", "Soup", "Toast"]);

function removeFirstLunch(lunches) {
  if(lunches.length === 0) {
    console.log("No lunches to remove.");
  } else {
    const removedItemFirst = lunches.shift();
    console.log(`${removedItemFirst} removed from the start of the lunch menu.`)
  }
  return lunches;
}
removeFirstLunch(["Sushi", "Pizza", "Burger"]);

function getRandomLunch(lunches) {
  if(lunches.length === 0) {
  console.log("No lunches available.");
} else {
  const randomIndex = Math.floor(Math.random() * lunches.length);
  console.log(`Randomly selected lunch: ${lunches[randomIndex]}`);
  }
  return lunches;
}

function showLunchMenu(lunches) {
  if(lunches.length === 0) {
    console.log("The menu is empty.");
  } else {
    console.log(`Menu items: ${lunches.join(", ")}`);
  }
  return lunches;
}
 showLunchMenu(["Greens", "Corns", "Beans"]);

```

### Your browser information:

User Agent is: `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0`

### Challenge Information:

Build a Lunch Picker Program - Build a Lunch Picker Program  
[https://www.freecodecamp.org/learn/full-stack-developer/lab-lunch-picker-program/build-a-lunch-picker-program](https://www.freecodecamp.org/learn/full-stack-developer/lab-lunch-picker-program/build-a-lunch-picker-program)

---

<div class="post-metadata">

**Author:** ![Teller](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/teller/32/412338_2.png) [@Teller](https://forum.freecodecamp.org/u/Teller)\
**Post date:** [July 25, 2025, 10:26pm UTC](https://forum.freecodecamp.org/t/build-a-lunch-picker-program-build-a-lunch-picker-program/756121/2 "2025-07-25T22:26:50Z")

</div>

Hi @pure53178

Currenly the lunch program can only add or remove items from either the start or end of the array.

If you want to level up, how about adding or removing items in between?

Happy coding

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [January 24, 2026, 10:27am UTC](https://forum.freecodecamp.org/t/build-a-lunch-picker-program-build-a-lunch-picker-program/756121/3 "2026-01-24T10:27:02Z")

</div>

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
