mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 01:17:50 +00:00
Remove constant function from examples (#3086)
This commit is contained in:
committed by
John-David Dalton
parent
64d92ddf32
commit
43a520c971
@@ -12,14 +12,14 @@ import invoke from './invoke.js'
|
||||
* @returns {Function} Returns the new invoker function.
|
||||
* @example
|
||||
*
|
||||
* const array = times(3, constant)
|
||||
* const array = times(3, i => () => i)
|
||||
* const object = { 'a': array, 'b': array, 'c': array }
|
||||
*
|
||||
* map(['a[2]', 'c[0]'], methodOf(object))
|
||||
* // => [2, 0]
|
||||
*
|
||||
* map([['a', '2'], ['c', '0']], methodOf(object))
|
||||
* // => [2, 0]
|
||||
* // => [2, 0]f
|
||||
*/
|
||||
function methodOf(object, args) {
|
||||
return (path) => invoke(object, path, args)
|
||||
|
||||
Reference in New Issue
Block a user