I have been able to pass the test but I also noticed that when I add console.log(low), the test will fail:
What could be the problem?
const LOCAL_FORECAST = {
yesterday: { low: 61, high: 75 },
today: { low: 64, high: 77 },
tomorrow: { low: 68, high: 80 }
};
// Only change code below this line
// const lowToday = LOCAL_FORECAST.today.low;
// const highToday = LOCAL_FORECAST.today.high;
const{today:{low: lowToday, high: highToday}} = LOCAL_FORECAST;
console.log(low)
// Only change code above this line
const LOCAL_FORECAST = {
yesterday: { low: 61, high: 75 },
today: { low: 64, high: 77 },
tomorrow: { low: 68, high: 80 }
};
// Only change code below this line
// const lowToday = LOCAL_FORECAST.today.low;
// const highToday = LOCAL_FORECAST.today.high;
const{today:{low: lowToday, high: highToday}} = LOCAL_FORECAST;
console.log(low)
// Only change code above this line
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36
Challenge: Use Destructuring Assignment to Assign Variables from Nested Objects
Link to the challenge: