So I was able to complete the challenge but where does “concat” come from? The variable name is “myConcat”. Appending ‘array 2’ to ‘array 1’ is… arr1.concat(arr2); ??? Is that how you append arrays together? I can only recall the push() shift() unshift() functions but do not understand how arr1.concat(arr2); would result in a single array in this case which has array 1’s contents followed by array 2’s in the same array (example [1, 2] [3, 4, 5] turning into [1, 2, 3, 4, 5].
Your code so far
const myConcat = (arr1, arr2) => arr1.concat(arr2);
// test your code
console.log(myConcat([1, 2], [3, 4, 5]));
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/es6/write-arrow-functions-with-parameters