Build a Recipe Tracker - Step 5

Tell us what’s happening:

Hello there :
could you help about the 5 Question:
You should assign the value of the name property of recipe1 to your recipe1name variable.

Your code so far

const recipes = [];

const recipe1 = {
  name: 'Spaghetti Carbonara',
  ingredients: ['spaghetti', 'Parmesan cheese', 'pancetta', 'black pepper'],
  cookingTime: 22,
  totalIngredients: null,
  difficultyLevel: '',
  ratings: [4, 5, 4, 5],
  averageRating: null,
};

const recipe2 = {
  name: 'Chicken Curry',
  ingredients: ['chicken breast', 'coconut milk', 'curry powder', 'onion', 'garlic'],
  cookingTime: 42,
  totalIngredients: null,
  difficultyLevel: '',
  ratings: [4, 5, 5, 5],
  averageRating: null,

// User Editable Region

};
 const recipe1Name = {
  name: recipe1,
  
};
 const recipe2Name = {
  name: recipe2,
};
 
console.log(recipe1Name);
console.log(recipe2Name);
  




// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36

Challenge Information:

Build a Recipe Tracker - Step 5

Hi.
What you are doing is creating objects and assiging them a reference, the lesson requires you to access already existing objects.

the hint is trying to ask you to follow the first part of the instructions which were:

Access the name properties of both recipe1 and recipe2 , and assign them to the variables recipe1Name and recipe2Name , respectively.

Try to break this instruction down into steps. What would the first step be here?

do you have any example , close to this ,
I tried many times and different ways, but does not work.

the examples are given in the instructions.

But you need to understand what you are trying to do first.

Let’s try to work out the instructions first?

An example is provided in the instructions.

Thank you very much ,
I got it.

1 Like