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. Use `Array.prototype.reduce()`, comparing the `length` of objects to find the longest one.
```js ```js
const longestItem = (...vals) => const longestItem = (...args) =>
vals.reduce((a, x) => (x.length > a.length ? x : a)); args.reduce((a, x) => (x.length > a.length ? x : a));
``` ```
```js ```js