Need help with destructuring assignment

Tell us what’s happening:

Your code so far


// Only change code below this line

const today = HIGH_TEMPERATURES.today;
const tomorrow = HIGH_TEMPERATURES.tomorrow;

const { today, tomorrow } = HIGH_TEMPERATURES;  

console.log(today);
console.log(tomorrow);
console.log(yesterday);
// Only change code above this line

Your browser information:

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

Challenge: Use Destructuring Assignment to Extract Values from Objects

Link to the challenge:

@naaih you got this right mate you just need to remove the consts above it

//remove
const today = HIGH_TEMPERATURES.today;
const tomorrow = HIGH_TEMPERATURES.tomorrow;

also remove the console.log(yesterday) too or it will fail

1 Like

thanks for the help, but my code is still not working. did what you said.

Just tried it, and it worked … only this part:

// Only change code below this line

const { today, tomorrow } = HIGH_TEMPERATURES;  

// Only change code above this line

Its says test completed. But cant go to the next lesson.

Can’t reproduce that … if you go here: https://www.freecodecamp.org/learn/ you can jump ahead as you please …

1 Like

JavaScript, or programming anything is inherently complex and difficult. While it’s a lifelong learning process, things do become a lot easier as you do them more often. Imagine you would do this exercise 5, 10, 20 or more times. At some point it becomes easy and you can combine it to solve even more interesting problems.

2 Likes

Thanks for that. Really appreciate it.

1 Like