Например:
Код: Выделить всё
List [
Object 1 {
filter: a,
value: 10,
total: ?
},
Object 2 {
filter: a,
value: 20,
total: ?
},
Object 3 {
filter: b,
value: 30,
total: ?
},
Object 4 {
filter: b,
value: 40,
total: ?
},
]
Код: Выделить всё
List [
Object 1 {
filter: a,
value: 10,
total: 30
},
Object 2 {
filter: a,
value: 20,
total: 30
},
Object 3 {
filter: b,
value: 30,
total: 70
},
Object 4 {
filter: b,
value: 40,
total: 70
},
]
Подробнее здесь: https://stackoverflow.com/questions/783 ... of-objects