mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 10:57:49 +00:00
Cleanup _.result.
This commit is contained in:
@@ -7338,10 +7338,10 @@
|
|||||||
* // => 'slate'
|
* // => 'slate'
|
||||||
*/
|
*/
|
||||||
function result(object, key, defaultValue) {
|
function result(object, key, defaultValue) {
|
||||||
if (object == null || typeof object[key] == 'undefined') {
|
var value = object == null ? undefined : object[key];
|
||||||
|
if (typeof value == 'undefined') {
|
||||||
return defaultValue;
|
return defaultValue;
|
||||||
}
|
}
|
||||||
var value = object[key];
|
|
||||||
return isFunction(value) ? object[key]() : value;
|
return isFunction(value) ? object[key]() : value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user