freeCodeCamp Challenge Guide: Use Destructuring Assignment to Assign Variables from Nested Objects

Use Destructuring Assignment to Assign Variables from Nested Objects


Hints

Hint 1

This challenge requires you to assign object property values to variables of different names.

Hint 2

The two lines declaring lowToday and highToday can be replaced with a single line that handles both values.


Solutions

Solution 1 (Click to Show/Hide)
const { today: { low: lowToday, high: highToday } } = LOCAL_FORECAST;
12 Likes