function removeLastLunch(arr) {
if (arr.length > 0) {
let result = arr.pop();
console.log(result + " removed from the end of the lunch menu.");
} else {
console.log(" No lunches to remove.");
}
return arr;
}
My code is not passing even though it works on my machine. I´m getting the following error that I cannot reproduce:
When the input array is empty, the function removeLastLunch should log the string "No lunches to remove." to the console.