I have the following object:
openingHours:{
thu: {
open: 12,
close : 22
},
fri: {
open:11,
close:23
},
sat: {
open: 0,
close:24
}
}
I want by rest pattern to get an object only with thu and sat e.g:
{
thu: {
open: 12,
close : 22
},
sat: {
open: 0,
close: 24
}
}
I know that i can do it in the follwoing way: const{fri,...otherDays} = openingHours
But in don't need the fri variable! Is there a way to destruct it the way i won't need to create a redundant variable fri