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.
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user