Skip to main content
Module

x/lodash_es/mod.ts>property

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

Creates a function that returns the value at path of a given object.

Examples

var objects = [ { 'a': { 'b': 2 } }, { 'a': { 'b': 1 } } ];

_.map(objects, _.property('a.b')); // => [2, 1]

.map(.sortBy(objects, _.property(['a', 'b'])), 'a.b'); // => [1, 2]

Parameters

path

The path of the property to get.