mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 15:57:48 +00:00
Cleanup _.result.
This commit is contained in:
@@ -7338,10 +7338,10 @@
|
||||
* // => 'slate'
|
||||
*/
|
||||
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;
|
||||
}
|
||||
var value = object[key];
|
||||
return isFunction(value) ? object[key]() : value;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user