What do you do when you have two arrays but only need one? You concat them:
var words = [“cockapoo”, “beefalo”]
var moreWords = [“pegacorn”, “schnoodle”]
var allWeirdWords = words.concat(moreWords)
// [ “cockapoo”, “beefalo”, “pegacorn”, “schnoodle” ]
Educative.io: Learn by Coding ⤵
Build real apps. No experience required. Check out “The Complete JS Course”Syntax
firstArray.concat(secondArray);
Remember! The array before the concat() method will be placed before the array inside the parenthesis once they are combined.