freeCodeCamp Challenge Guide: Write Arrow Functions with Parameters

Write Arrow Functions with Parameters


Problem Explanation

Now, you are tasked at putting parameters inside arrow functions.


Hints

Hint 1

Get rid of the function keyword. Put the arrow operator.

Hint 2

Make sure you changed the var to a const.


Solutions

Solution 1 (Click to Show/Hide)
const myConcat = (arr1, arr2) => {
  "use strict";
  return arr1.concat(arr2);
};
// test your code
console.log(myConcat([1, 2], [3, 4, 5]));
3 Likes