I have the following object:
const restaurant = {
openingHours: {
thu: {
open: 12,
close: 22,
},
fri: {
open: 11,
close: 23,
},
saturday: {
open: 0, // Open 24 hours
close: 24,
},
}
};
and two pieces of code that achieve the same result but are written a little bit differently:
const { fri } = restaurant.openingHours;
const friday = { ...fri };
this above is Spread syntax for sure
const { fri: {...friday} } = restaurant.openingHours;
Is the second one is a Rest syntax? I'm not sure what is the order of the assignment (that includes also destructing) in the code