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 = [
  'whipped cream'

JavaScript Concepts: Data Structures (arrays), Variable Declaration, Calling Functions, Identifiers

listed #2