take the two variables a and b as a two different arrays the variable c shows the output in only one array that means this method merges the two or more arrays into a single array
let a=[a,b];
let b=[c,d];
c=[a,...b]
output = [[a,b],c,d]
take the two variables a and b as a two different arrays the variable c shows the output in only one array that means this method merges the two or more arrays into a single array
let a=[a,b];
let b=[c,d];
c=[a,...b]
output = [[a,b],c,d]
2
Answers
If you want merge array a & b you should use spread like this:
let c=[...a,...b]
You can spread both arrays in order to get merged one single dimentional array
output
Spread operator in javascript spreads contents of Array and Objects,
So, writing
you can use these spreaded elements,
In a Function as arguments
To Form Another Array
You can also create object
And Many more things