--- id: 587d7b88367417b2b2512b44 title: Write Arrow Functions with Parameters challengeType: 1 forumTopicId: 301223 localeTitle: Функции записи стрелки с параметрами --- ## Description
Подобно нормальной функции, вы можете передавать аргументы в функции стрелок.
// удваивает входное значение и возвращает его
const doubler = (item) => item * 2;
Вы можете передать более одного аргумента в функции стрелок.
## Instructions
Перепишите функцию myConcat которая добавляет содержимое arr2 в arr1 чтобы функция использовала синтаксис функции стрелки.
## Tests
```yml tests: - text: User did replace var keyword. testString: getUserInput => assert(!getUserInput('index').match(/var/g)); - text: myConcat should be a constant variable (by using const). testString: getUserInput => assert(getUserInput('index').match(/const\s+myConcat/g)); - text: myConcat should be a function testString: assert(typeof myConcat === 'function'); - text: myConcat() returns the correct array testString: assert(() => { const a = myConcat([1], [2]); return a[0] == 1 && a[1] == 2; }); - text: function keyword was not used. testString: getUserInput => assert(!getUserInput('index').match(/function/g)); ```
## Challenge Seed
```js var myConcat = function(arr1, arr2) { "use strict"; return arr1.concat(arr2); }; // test your code console.log(myConcat([1, 2], [3, 4, 5])); ```
## Solution
```js const myConcat = (arr1, arr2) => { "use strict"; return arr1.concat(arr2); }; // test your code console.log(myConcat([1, 2], [3, 4, 5])); ```