2018-10-12 15:37:13 -04:00
---
title: Write Arrow Functions with Parameters
---
2019-07-24 00:59:27 -07:00
# Write Arrow Functions with Parameters
2018-10-12 15:37:13 -04:00
2019-07-24 00:59:27 -07:00
---
## Problem Explanation
2018-10-12 15:37:13 -04:00
Here is a [cool resource about anonymous functions in JavaScript ](http://helephant.com/2008/08/23/javascript-anonymous-functions/ ), in case you are still wondering what they are, and their role.
Now, you are tasked at putting parameters inside arrow functions.
2019-07-24 00:59:27 -07:00
---
## Hints
### Hint 1
2018-10-12 15:37:13 -04:00
Get rid of the `function` keyword. Put the arrow operator.
2019-07-24 00:59:27 -07:00
### Hint 2
2018-10-12 15:37:13 -04:00
Make sure you changed the `var` to a `const` .
2019-07-24 00:59:27 -07:00
---
## Solutions
< details > < summary > Solution 1 (Click to Show/Hide)< / summary >
2018-10-12 15:37:13 -04:00
```javascript
const myConcat = (arr1, arr2) => {
"use strict";
return arr1.concat(arr2);
};
// test your code
console.log(myConcat([1, 2], [3, 4, 5]));
```
2019-07-24 00:59:27 -07:00
< / details >