Bake a Pie explainer

The aim of this puzzle: Make a list (array) of ingredients (strings) needed to bake a pie.

Walkthrough of the solution: The cook() function is ready to turn ingredients into a pie but right now ingredients is just ‘apples’.

First, tap on the string ‘apples’ to highlight it. Next, tap the [] button to replace ‘apples’ with an empty array []. Now tap the str button to open the keyboard and type in the name of an ingredient like ‘chocolate’ or ‘cream’. Tap the empty space below the new ingredient you just entered and add another.

Once you have at least 3 strings inside the ingredients array, try running the code to bake your pie.

Sample code solution:
(Tap below to reveal)

var ingredients = [
  'crust',
  'chocolate',
  'whipped cream'
];
cook(ingredients);

JavaScript Concepts: Data Structures (arrays), Variable Declaration, Calling Functions, Identifiers
Additional Code (hidden code that runs before the puzzle’s code):

const cook = input => {
    print(!Array.isArray(input)
      ? `That isn't an array.`
      : input.filter(i=>typeof i === 'string').length !== input.length
        ? `The array should only contain strings.`
        : input.length < 3 
          ? `The array has ${input.length} item${input.length===1?'':'s'}. It needs ${3-input.length} more.`
          : `${input.join` + `}...completes the pie!`
    );
};

But there are phrases that we did not write as well at the end of the code