var data = [
{
name : "Micah Richards",
position : "Centre Back"
},
{
name: "Kieran Richardson",
position: "Left-Back"},
{
name: "Rudy Gestede",
position: "Centre"},
{
name: "Jack Grealish",
position: "Left Wing"},
{
name: "Brad Guzan",
position: "Keeper"
}
]
У меня есть объекты JSON. Как преобразовать, как ниже объект JSON, используя lodash?lodash - Создать новые группы и нажать объекты
var data = {
defenders: [
{
name: "Micah Richards",
position: "Centre Back"
},
{
name: "Kieran Richardson","position":"Left-Back"
}
],
"midfielder" :
[{"name":"Rudy Gestede","position":"Forward"},
{"name":"Jack Grealish","position":"Left Wing"}],
"keeper":[ {"name":"Brad Guzan","position":"Keeper"}]}
Вот что мне нужно - спасибо Мик. –