Back to Freecodecamp

Step 2

curriculum/challenges/english/blocks/workshop-recipe-tracker/66fbcf750a62784cf11f562d.md

latest1.2 KB
Original Source

--description--

Create an object named recipe1. Inside the recipe1 object, create a name property with the value "Spaghetti Carbonara".

Also inside the recipe1 object, create an ingredients property with an array as the value. The array should have spaghetti, Parmesan cheese, pancetta, and black pepper inside it.

--hints--

You should create an object named recipe1.

js
assert.isObject(recipe1);

Your recipe1 object should have a name property.

js
assert.property(recipe1, 'name');

Your name property should be set to Spaghetti Carbonara.

js
assert.equal(recipe1.name, 'Spaghetti Carbonara');

Your recipe1 object should have an ingredients property.

js
assert.property(recipe1, 'ingredients');

Your ingredients property should have an array value.

js
assert.isArray(recipe1.ingredients);

The array value of your ingredients property should have spaghetti, Parmesan cheese, pancetta, and black pepper in it.

js
assert.deepEqual(recipe1.ingredients, ["spaghetti", "Parmesan cheese", "pancetta", "black pepper"]);

--seed--

--seed-contents--

js
const recipes = [];
--fcc-editable-region--

--fcc-editable-region--