-2

Similar answers found Here

Good day all. I have an object that looks like this:

{
ID1: {
  completedThis: true,
  completedThat: false, 
  isArchived: true,
},
ID2: {
  completedThis: true,
  completedThat: false, 
  isArchived: true,
},
}

I need to access the data point, "isArchived", from the value of each key(ID..) and then do something with it. I don't want to change the original object while doing this. I really appreciate any and all feedback!

kinzito17
  • 250
  • 2
  • 16

1 Answers1

1
Object.values({
    ID1: {
        completedThis: true,
        completedThat: false,
        isArchived: true,
    },
    ID2: {
        completedThis: true,
        completedThat: false,
        isArchived: true,
    },
}).forEach(value => console.log(value.isArchived))