Could someone please help me understand the following:
const myConcat = (arr1, arr2) => arr1.concat(arr2);
console.log(myConcat([1, 2], [3, 4, 5]));
Output: [ 1, 2, 3, 4, 5 ]
I understand the point of this challenge which is to rewrite the regular function as an arrow function with parameters.
What I have trouble understanding is this part:
arr1.concat(arr2)
Which part of the code above appends the array together? And how does it do that?
Thanks in advance!