const cond = false
const extraInfo = [
{
a: 11,
b: 25
},
{
a: 12,
b: 34
},
{
a: 1,
c: 99
}
]
const userInfo = [
{
z: 8
},
let getMyValue = cond ? [].concat(extraInfo, userInfo) : userInfo;
let check this
const extraInfo = [
{
a: 11,
b: 25
},
{
a: 12,
b: 34
},
{
a: 1,
c: 99
}
];
const userInfo = [
{
z: 8
},
{
z: 10
},
];
const cond = false;
let getMyValue = cond ? [].concat(extraInfo, userInfo) : userInfo;
console.log(getMyValue)