Change argument name

This commit is contained in:
Siarhei
2018-10-19 14:05:16 +04:00
parent 73dfb96c11
commit db2d690b2c

View File

@ -7,8 +7,8 @@ Returns `undefined` if no arguments are provided.
Use `Array.prototype.reduce()`, comparing the `length` of objects to find the longest one.
```js
const longestItem = (...vals) =>
vals.reduce((a, x) => (x.length > a.length ? x : a));
const longestItem = (...args) =>
args.reduce((a, x) => (x.length > a.length ? x : a));
```
```js