No lunches to remove

const removeFirstLunch = (array) => {

  let firstLunchRemoved = array.shift();

  console.log(firstLunchRemoved);

  let arrayLength = array.length;

  if(arrayLength === 0){

      console.log("No lunches to remove.")

  } else {

      console.log(\`${firstLunchRemoved} removed from the start of the lunch menu.\`)

  } 

  return array;

}

Returning error 17. When the input array is empty, the function removeFirstLunch should log the string “No lunches to remove.” to the console.

Please post all of your code and a link to the step - thanks


It looks like you have an order of operations problem. What should happen if there was only 1 lunch left?

I’ve edited your post to improve the readability of the code. When you enter a code block into a forum post, please precede it with three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add the backticks.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').