我有两个JSON数组,
A:
[ {"id": 123, "name": "AnyName1", "type": "AnyType"},
{"id": 231, "name": "AnyName2", "type": "AnyType"} ]
B:
[ {"id": 569, "thing": "AnyThing3"},
{"id": 891, "thing": "AnyThing4"} ]
我想将这两个数组(与id无关)合并到一个普通的JSON数组中:
C = A + B:
[ {"id": 123, "name": "AnyName1", "type": "AnyType"},
{"id": 231, "name": "AnyName2", "type": "AnyType"},
{"id": 569, "thing": "AnyThing3"},
{"id": 891, "thing": "AnyThing4"} ]
我想在不使用循环的情况下实现这一目标。有人可以在Typescript中以任何快捷方式帮助我吗?