destructure take one variable and the rest in other variable code example
Example 1: how to use object destructuring to spread part of an object into another
how to use object destructuring to spread part of an object into another
Example 2: Destructuring Assignment
const HIGH_TEMPERATURES = {
yesterday: 75,
today: 77,
tomorrow: 80
};
const {today, tomorrow} = HIGH_TEMPERATURES;
const today = HIGH_TEMPERATURES.today;
const tomorrow = HIGH_TEMPERATURES.tomorrow;
console.log(today);
console.log(tomorrow);
console.log(yesterday);