How do i concatenate these two arrays to get the expected output?
let bidder= [
[1,2,3,4],
[5,6,7,8]
]
let arr1 = [9,10,11,12]
expected result
[
(4) [...],
(4) [...],
(4) [...],
]
How do i concatenate these two arrays to get the expected output?
let bidder= [
[1,2,3,4],
[5,6,7,8]
]
let arr1 = [9,10,11,12]
expected result
[
(4) [...],
(4) [...],
(4) [...],
]
const bidder= [
[1,2,3,4],
[5,6,7,8]
]
const arr1 = [9,10,11,12];
const result = [...bidder, arr1];
console.log(result);
You can use spread
operator to spread whatever is in bidder array and add your other array as the last one in a new array.