ES6 - Write Arrow Functions with Parameters

Tell us what’s happening:
i don’t know what I’m getting wrong here. Pls can anyone be of help to me?

** const myConcat = (arr1, arr2) => arr1.push(arr2);
console.log(myConcat([1, 2], [3, 4, 5]));**


const myConcat = (arr1, arr2) => arr1.push(arr2);
console.log(myConcat([1, 2], [3, 4, 5]));

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36

Challenge: ES6 - Write Arrow Functions with Parameters

Link to the challenge:

Hi there. I looked back at the assignment. It looks like it wants you to use .concat instead of .push. hope that helps

Also, fyi, if you use push for this and want final to be [1, 2, 3, 4, 5] you woul use arr1.push(…arr2)

The way you wrote it i believe youd get [1, 2, [3, 4, 5]] bc it pushes the the whole arr2

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.