猿问

数组对象的合并

let a = [{name: '', age: '', sex: ''},{name: '', age: '', sex: ''},{name: '', age: '', sex: ''}];
let b=[{name: '', age: '', sex: ''},{name: '', age: '', sex: ''},{name: '', age: '', sex: ''}];

用什么方法将两个数组进行合并?得到 c = [{name: '', age: '', sex: ''},{name: '', age: '', sex: ''},{name: '', age: '', sex: ''},{name: '', age: '', sex: ''},{name: '', age: '', sex: ''},{name: '', age: '', sex: ''}];


慕雪6442864
浏览 380回答 3
3回答

缥缈止盈

    let a = [{name: '', age: '', sex: ''},{name: '', age: '', sex: ''},{name: '', age: '', sex: ''}];    let b=[{name: '', age: '', sex: ''},{name: '', age: '', sex: ''},{name: '', age: '', sex: ''}];    let  c=a.concat(b)    console.log(c)

临摹微笑

a.concat(b)
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答