Apply new format to snippets and template
This commit is contained in:
@ -7,7 +7,7 @@ Takes any number of iterable objects or objects with a `length` property and ret
|
||||
If multiple objects have the same length, the first one will be returned.
|
||||
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
|
||||
const longestItem = (...vals) => vals.reduce((a, x) => (x.length > a.length ? x : a));
|
||||
|
||||
Reference in New Issue
Block a user