ES6: Use Destructuring Assignment to Extract Values from Objects

Can you explain what am I doing wrong and what’s the correct way of doing this.

Your code so far


const HIGH_TEMPERATURES = {
yesterday: 75,
today: 77,
tomorrow: 80
};

// change code below this line

const { yesterday, today, tomorrow } = HIGH_TEMPERATURES;

// change code above this line

console.log(yesterday) // should be not defined
console.log(today); // should be 77
console.log(tomorrow); // should be 80

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36.

Challenge: Use Destructuring Assignment to Extract Values from Objects

Link to the challenge:

you are defining here also the yesterday variable, when you are asked to not do that

1 Like

How can code this challenge the correct way?

do not create a yesterday variable in that line

in the line const { yesterday, today, tomorrow } = HIGH_TEMPERATURES; you are creating yesterday, today and tomorrow and taking their values from HIGH_TEMPERATURES using destructuring.

Just, don’t create the yesterday variable

Can you please show me what I need to do please?

remove the declaration of the yesterday variable.

Here you are delcaraning yesteray, today and tomorrow:
const { yesterday, today, tomorrow } = HIGH_TEMPERATURES;

You need to remove the declaration of yesterday

I’ve done it now can you please help me with another problem please

if it is for this challenge, you can ask here

if it is for a different challenge use the ask for help button to create a different topic, with your code and the challenge link

I’m having trouble to collapse my navigation on a small screen on an iPhone like this website http://www.rnaplant.co.uk/.

Please view what I’ve done so far http://siondafydd-com.stackstaging.com/

Can you please help me with my issues as It’s stressing me out can you please help me with it.

You have already a thread on this topic, please keep using that thread.

I’m. not getting anywhere can you please help me?