我有两个对象数组(a和b)。我想从其他新结果数组中的a []其中b []中选择对象

时间:2019-03-29 09:43:02

标签: javascript

我想在其他数组中以不同的数组ID和数组值推送两个或多个数组

var a =[{id:1,name:'hari'},{id:2,name:'manish'}]
var b =[{id:1,name:'syam'},{id:2,name:'naresh'}]

我想将数组a和b推入其他数组结果并获取结果数组

var result = [ {a:[{id:1,name:'hari'},{id:2,name:'manish'}]},{b:[{id:1,name:'syam'},{id:2,name:'naresh'}]}]

0 个答案:

没有答案