I need help in passing 23, 24, 29,30. Any help is appreciated.
Your code so far
let lunches = []
function addLunchToEnd(array,word){
array.push(word)
console.log(`${word} added to the end of the lunch menu.`)
return array
}
function addLunchToStart(array, word){
array.unshift(word)
console.log(`${word} added to the start of the lunch menu.`)
return array
}
function removeLastLunch(array){
let removedValue = array.pop();
if(array.length === 0){
console.log("No lunches to remove.")
}else{
console.log(`${removedValue} removed from the end of the lunch menu.`)
}
return array;
}
function removeFirstLunch(array){
let addedValue = array.shift();
if(array.length === 0){
console.log("No lunches to remove.")
}else{
console.log(`${addedValue} removed from the start of the lunch menu.`);
}
return array;
}
function getRandomLunch(array){
let randomArray = array[getRandomInt(0,array.length)];
if(randomArray){
console.log(`Randomly selected lunch: ${randomArray}`)
}
if(randomArray === 0){
console.log("No lunches available.")
}
}
function showLunchMenu(array){
if(array.length === 0){
console.log("The menu is empty.")
}else{
console.log(`Menu items: ${array}`)
}
}
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/154.0.0.0 Safari/537.36
Challenge Information:
Build a Lunch Picker Program - Build a Lunch Picker Program