I have the following object:
export const data = {
tasks: {
"Cleaning": {
personA: 1,
personB: 0.5,
personC: 0.1,
personD: 0,
},
"Washing": {
personA: 1,
personB: 0.5,
personC: 0.1,
personD: 0,
},
"Something else": {
personA: 1,
personB: 0.3,
personC: 0.2,
personD: 0.3,
},
}
}
What I want to have now is four arrays that contain all values for each person:
person A = [1, 1, 1]
person B = [0.5, 0.5, 0.3]
person C = [0.1, 0.2, 0.3]
person D = [0, 0, 0.3]
I already tried some approaches with Object.values() but I'm totally stuck at the moment. How can I achieve this?