diff --git a/snippets/longestItem.md b/snippets/longestItem.md index dd8203682..a8a7fd63e 100644 --- a/snippets/longestItem.md +++ b/snippets/longestItem.md @@ -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