I've got an object and i want to iterate through all of its subobjects/keys that hold the key-value pair 'pool: "luxury"'. Or in other words I want to iterate throu all rooms that are in the pool luxury to set a new parameter. What is a proper and efficient way to do that in js?
var rooms = {
SU01: {
enabled: true,
pool: "comfort",
ics_lnk : "https://avlblty.com/su01.ics",
ics_txt : "",
},
SU02: {
enabled: true,
pool: "luxury",
ics_lnk : "https://avlblty.com/su02.ics",
ics_txt : "",
},
SU03: {
enabled: true,
pool: "luxury",
ics_lnk : "https://avlblty.com/su03.ics",
ics_txt : "",
},
SU11: {
enabled: true,
pool: "comfort",
ics_lnk : "https://avlblty.com/su11.ics",
ics_txt : "",
},
SU12: {
enabled: true,
pool: "luxury",
ics_lnk : "https://avlblty.com/su12.ics",
ics_txt : "",
},
...
roomsobject.