Change argument name
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user