diff --git a/dropRightWhile.js b/dropRightWhile.js index 470cbd8fc..d5a8039ba 100644 --- a/dropRightWhile.js +++ b/dropRightWhile.js @@ -13,12 +13,12 @@ import baseWhile from './.internal/baseWhile.js'; * @example * * const users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': true }, + * { 'user': 'pebbles', 'active': true } * ]; * - * dropRightWhile(users, o => !o.active); + * dropRightWhile(users, ({ active }) => active); * // => objects for ['barney'] */ function dropRightWhile(array, predicate) { diff --git a/dropWhile.js b/dropWhile.js index 327f8fc06..db7419376 100644 --- a/dropWhile.js +++ b/dropWhile.js @@ -13,12 +13,12 @@ import baseWhile from './.internal/baseWhile.js'; * @example * * const users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': true }, + * { 'user': 'pebbles', 'active': false } * ]; * - * dropWhile(users, o => !o.active); + * dropWhile(users, ({ active }) => active); * // => objects for ['pebbles'] */ function dropWhile(array, predicate) { diff --git a/filter.js b/filter.js index 9ea892e8f..4f26d3570 100644 --- a/filter.js +++ b/filter.js @@ -17,12 +17,12 @@ import baseFilter from './.internal/baseFilter.js'; * @example * * const users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false } + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false } * ]; * - * filter(users, o => !o.active); - * // => objects for ['fred'] + * filter(users, ({ active }) => active); + * // => objects for ['barney'] */ function filter(collection, predicate) { const func = Array.isArray(collection) ? arrayFilter : baseFilter; diff --git a/find.js b/find.js index 8b406fe27..2996676a3 100644 --- a/find.js +++ b/find.js @@ -20,7 +20,7 @@ import findIndex from './findIndex.js'; * { 'user': 'pebbles', 'age': 1, 'active': true } * ]; * - * find(users, o => o.age < 40); + * find(users, ({ age }) => age < 40); * // => object for 'barney' */ const find = createFind(findIndex); diff --git a/findIndex.js b/findIndex.js index fcf811742..378b59095 100644 --- a/findIndex.js +++ b/findIndex.js @@ -22,7 +22,7 @@ const nativeMax = Math.max; * { 'user': 'pebbles', 'active': true } * ]; * - * findIndex(users, o => o.user == 'barney'); + * findIndex(users, ({ user }) => user == 'barney'); * // => 0 */ function findIndex(array, predicate, fromIndex) { diff --git a/findKey.js b/findKey.js index 3d7ea3128..ea98c6efa 100644 --- a/findKey.js +++ b/findKey.js @@ -19,7 +19,7 @@ import baseForOwn from './.internal/baseForOwn.js'; * 'pebbles': { 'age': 1, 'active': true } * }; * - * findKey(users, o => o.age < 40); + * findKey(users, ({ age }) => age < 40); * // => 'barney' (iteration order is not guaranteed) */ function findKey(object, predicate) { diff --git a/findLastIndex.js b/findLastIndex.js index 53f742908..7de716b8d 100644 --- a/findLastIndex.js +++ b/findLastIndex.js @@ -23,7 +23,7 @@ const nativeMin = Math.min; * { 'user': 'pebbles', 'active': false } * ]; * - * findLastIndex(users, o => o.user == 'pebbles'); + * findLastIndex(users, ({ user }) => user == 'pebbles'); * // => 2 */ function findLastIndex(array, predicate, fromIndex) { diff --git a/findLastKey.js b/findLastKey.js index 8ed2f1d8a..768255e15 100644 --- a/findLastKey.js +++ b/findLastKey.js @@ -19,7 +19,7 @@ import baseForOwnRight from './.internal/baseForOwnRight.js'; * 'pebbles': { 'age': 1, 'active': true } * }; * - * findLastKey(users, o => o.age < 40); + * findLastKey(users, ({ age }) => age < 40); * // => returns 'pebbles' assuming `findKey` returns 'barney' */ function findLastKey(object, predicate) { diff --git a/mapValues.js b/mapValues.js index a8cd437c1..0269a256e 100644 --- a/mapValues.js +++ b/mapValues.js @@ -20,7 +20,7 @@ import baseForOwn from './.internal/baseForOwn.js'; * 'pebbles': { 'user': 'pebbles', 'age': 1 } * }; * - * mapValues(users, o => o.age); + * mapValues(users, ({ age }) => age); * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) */ function mapValues(object, iteratee) { diff --git a/maxBy.js b/maxBy.js index 22cfb8a5b..ffef3f78e 100644 --- a/maxBy.js +++ b/maxBy.js @@ -14,7 +14,7 @@ import isSymbol from './isSymbol.js'; * * const objects = [{ 'n': 1 }, { 'n': 2 }]; * - * maxBy(objects, o => o.n); + * maxBy(objects, ({ n }) => n); * // => { 'n': 2 } */ function maxBy(array, iteratee) { diff --git a/meanBy.js b/meanBy.js index 535ec8d27..1c57c25d4 100644 --- a/meanBy.js +++ b/meanBy.js @@ -17,7 +17,7 @@ const NAN = 0 / 0; * * const objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; * - * meanBy(objects, o => o.n); + * meanBy(objects, ({ n }) => n); * // => 5 */ function meanBy(array, iteratee) { diff --git a/minBy.js b/minBy.js index 743642b7a..c0fc65904 100644 --- a/minBy.js +++ b/minBy.js @@ -14,7 +14,7 @@ import isSymbol from './isSymbol.js'; * * const objects = [{ 'n': 1 }, { 'n': 2 }]; * - * minBy(objects, o => o.n); + * minBy(objects, ({ n }) => n); * // => { 'n': 1 } */ function minBy(array, iteratee) { diff --git a/reject.js b/reject.js index 6a91ddf62..df39b2218 100644 --- a/reject.js +++ b/reject.js @@ -15,11 +15,11 @@ import negate from './negate.js'; * @example * * const users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': true } + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false } * ]; * - * reject(users, o => !o.active); + * reject(users, ({ active }) => active); * // => objects for ['fred'] */ function reject(collection, predicate) { diff --git a/sortedIndexBy.js b/sortedIndexBy.js index ff4b46608..de914f543 100644 --- a/sortedIndexBy.js +++ b/sortedIndexBy.js @@ -14,9 +14,9 @@ import baseSortedIndexBy from './.internal/baseSortedIndexBy.js'; * into `array`. * @example * - * const objects = [{ 'x': 4 }, { 'x': 5 }]; + * const objects = [{ 'n': 4 }, { 'n': 5 }]; * - * sortedIndexBy(objects, { 'x': 4 }, o => o.x); + * sortedIndexBy(objects, { 'n': 4 }, ({ n }) => n); * // => 0 */ function sortedIndexBy(array, value, iteratee) { diff --git a/sortedLastIndexBy.js b/sortedLastIndexBy.js index 325ab21d9..519027bd0 100644 --- a/sortedLastIndexBy.js +++ b/sortedLastIndexBy.js @@ -14,9 +14,9 @@ import baseSortedIndexBy from './.internal/baseSortedIndexBy.js'; * into `array`. * @example * - * const objects = [{ 'x': 4 }, { 'x': 5 }]; + * const objects = [{ 'n': 4 }, { 'n': 5 }]; * - * sortedLastIndexBy(objects, { 'x': 4 }, o => o.x); + * sortedLastIndexBy(objects, { 'n': 4 }, ({ n }) => n); * // => 1 */ function sortedLastIndexBy(array, value, iteratee) { diff --git a/sumBy.js b/sumBy.js index 638239f3b..596742d63 100644 --- a/sumBy.js +++ b/sumBy.js @@ -14,7 +14,7 @@ import baseSum from './.internal/baseSum.js'; * * const objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; * - * sumBy(objects, o => o.n); + * sumBy(objects, ({ n }) => n); * // => 20 */ function sumBy(array, iteratee) { diff --git a/takeRightWhile.js b/takeRightWhile.js index 63ebf9dd3..0c468006e 100644 --- a/takeRightWhile.js +++ b/takeRightWhile.js @@ -13,12 +13,12 @@ import baseWhile from './.internal/baseWhile.js'; * @example * * const users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': true }, + * { 'user': 'pebbles', 'active': true } * ]; * - * takeRightWhile(users, o => !o.active); + * takeRightWhile(users, ({ active }) => active); * // => objects for ['fred', 'pebbles'] */ function takeRightWhile(array, predicate) { diff --git a/takeWhile.js b/takeWhile.js index c9c889ba5..51458714a 100644 --- a/takeWhile.js +++ b/takeWhile.js @@ -13,12 +13,12 @@ import baseWhile from './.internal/baseWhile.js'; * @example * * const users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': true }, + * { 'user': 'pebbles', 'active': false } * ]; * - * takeWhile(users, o => !o.active); + * takeWhile(users, ({ active }) => active); * // => objects for ['barney', 'fred'] */ function takeWhile(array, predicate) {