Tell us what’s happening:
ok i know this is correct already. but i am still struggling with is the how of it. how is this destructuring the object?? its not m!king much sense to me in my head.
Your code so far
const HIGH_TEMPERATURES = {
yesterday: 75,
today: 77,
tomorrow: 80
};
// change code below this line
const {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 (Linux; Android 5.1.1; KFDOWI) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36
.
Challenge: Use Destructuring Assignment to Extract Values from Objects
Link to the challenge:
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-extract-values-from-objects