Module

x/lodash_es/src/object.js>result

lodash for deno use
Latest
function result
import { result } from "https://dotland.deno.dev/x/lodash_es@v0.0.2/src/object.js";

This method is like _.get except that if the resolved value is a function it's invoked with the this binding of its parent object and its result is returned.

Examples

var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };

_.result(object, 'a[0].b.c1'); // => 3

_.result(object, 'a[0].b.c2'); // => 4

_.result(object, 'a[0].b.c3', 'default'); // => 'default'

_.result(object, 'a[0].b.c3', _.constant('default')); // => 'default'

Parameters

object

The object to query.

path

The path of the property to resolve.

defaultValue