mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 00:27:50 +00:00
Tweak _.at and _.matchesProperty doc examples. [ci skip]
This commit is contained in:
@@ -6108,8 +6108,8 @@
|
||||
* _.at(['a', 'b', 'c'], [0, 2]);
|
||||
* // => ['a', 'c']
|
||||
*
|
||||
* _.at(['fred', 'barney', 'pebbles'], 0, 2);
|
||||
* // => ['fred', 'pebbles']
|
||||
* _.at(['barney', 'fred', 'pebbles'], 0, 2);
|
||||
* // => ['barney', 'pebbles']
|
||||
*/
|
||||
var at = restParam(function(collection, props) {
|
||||
var length = collection ? collection.length : 0;
|
||||
@@ -11018,13 +11018,12 @@
|
||||
* @example
|
||||
*
|
||||
* var users = [
|
||||
* { 'user': 'barney', 'age': 36 },
|
||||
* { 'user': 'fred', 'age': 40 },
|
||||
* { 'user': 'pebbles', 'age': 1 }
|
||||
* { 'user': 'barney' },
|
||||
* { 'user': 'fred' }
|
||||
* ];
|
||||
*
|
||||
* _.find(users, _.matchesProperty('user', 'fred'));
|
||||
* // => { 'user': 'fred', 'age': 40 }
|
||||
* // => { 'user': 'fred' }
|
||||
*/
|
||||
function matchesProperty(key, value) {
|
||||
return baseMatchesProperty(key + '', baseClone(value, true));
|
||||
|
||||
Reference in New Issue
Block a user