HOLA我的朋友在那裏, 我期待從這個transfor對象數組res
:使用添加父鍵對象數組lodash
[{
"Key1": 1,
"Key2": "James",
},
{
"Key1: 2,
"Key2": "John",
}]
這(基本上將在父鍵每個對象陣列):
[{"ParentKey":
{
"Key1" : 1,
"Key2" : James"
}
},
{"ParentKey":
{
"Key1" : 2,
"Key2" : "John"
}
}]
可能沒有使用bruteforce方法(for循環),但也許lodash?
非常感謝