[{
skills: [{
level: 22,
name: "Anna",
}, {
level: 31,
name: "Pasha"
}, {
level: 11,
name: "Igor"
}],
id: "1"
}, {
skills: [{
level: 2,
name: "Anna",
}, {
level: 35,
name: "Pasha"
}, {
level: 335,
name: "Igor"
}],
id: "2"
}, {
skills: [{
level: 101,
name: "Anna",
}, {
level: 77,
name: "Pasha"
}, {
level: 12,
name: "Igor"
}],
id: "3"
}]
Допустим я хочу новый массив, который отсортирован по полю level, где name = "Anna". Как это сделать? Новый массив должен быть такой:
[, {
skills: [{
level: 101,
name: "Anna",
}, {
level: 77,
name: "Pasha"
}, {
level: 12,
name: "Igor"
}],
id: "3"
}, {
skills: [{
level: 22,
name: "Anna",
}, {
level: 31,
name: "Pasha"
}, {
level: 11,
name: "Igor"
}],
id: "1"
}, {
skills: [{
level: 2,
name: "Anna",
}, {
level: 35,
name: "Pasha"
}, {
level: 335,
name: "Igor"
}],
id: "2"
}]