Tell us what’s happening:
Describe your issue in detail here.
**Your code so far**
const myConcat =(arr1, arr2) => arr1 + arr2
myConcat= arr1.concat(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/96.0.4664.110 Safari/537.36
Challenge: Write Arrow Functions with Parameters
Link to the challenge:
Exotic
December 28, 2021, 2:37pm
2
The function isnt an ‘arrow function’ as you failed to wrap it in curly brackets {} plus the code isnt correct, try adding return instead of assigning it to a variable and remove the arr1 + arr2 because thats what the arr1.concat(arr2) is doing
If you need the solution=>
const myConcat = (arr1, arr2) => {
return arr1.concat(arr2);
};
console.log(myConcat([1, 2], [3, 4, 5]));
Good luck !
1 Like
Thank you for your great response
system
Closed
June 29, 2022, 5:27pm
4
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.