You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can provide a third argument to `_.collate` to influence how array elements are evaluated while sorting.
115
+
You can provide a third argument to `_.collate` to influence how array elements are evaluated while sorting. This argument will be passed through `_.iteratee()` in order to obtain a function that returns the sorting value.
116
116
117
-
If the third argument is a string, `_.collate` will look for a property with that name on each array element, and that value will be used for sorting.
117
+
For example, if the third argument is a string, `_.collate` will look for a property with that name on each array element, and that value will be used for sorting.
You may also pass a function as the third argument; it will be executed once for each item (with the original list as `this`, and the item as its argument), with its return used as the item's sort value.
128
+
You may also directly pass a function as the third argument; it will be executed once for each item (with the original list as `this`, and the item as its argument), with its return used as the item's sort value.
0 commit comments