Skip to main content
Module

x/lodash_es/mod.ts>get

lodash for deno use
Latest
function get
import { get } from "https://deno.land/x/lodash_es@v0.0.2/mod.ts";

Gets the value at path of object. If the resolved value is undefined, the defaultValue is returned in its place.

Examples

var object = { 'a': [{ 'b': { 'c': 3 } }] };

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

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

_.get(object, 'a.b.c', 'default'); // => 'default'

Parameters

object

The object to query.

path

The path of the property to get.

defaultValue