Skip to content

Get Property

Malexion edited this page Oct 31, 2016 · 1 revision

__.prop(obj, path)

  • obj Item to search for the specified path.
  • path String path can be like: 'myproperty' or 'chain.sub.myproperty.value' or even '' to return original object.

Examples

var prop = __.prop({ chain: { p: 2, v: 'hello' } }, 'chain.v');

console.log(prop);

prop = __.prop({ chain: { p: 2, v: 'hello' } }, 'chain.x.y.z.hello.world');

console.log(prop);
Clone this wiki locally