Get a nested property or its value from an object using simple
a.b.c
paths.
var get = require('get-property');
var obj = {a: 'a', b: {c: 'd'}};
get(obj, 'b.c');
//=> {c: 'd'}
get({a: 'a', b: 'b'}, 'a');
//=> {a: 'a'}
get({a: 'a', b: {c: 'd'}}, 'b.c');
//=> {c: 'd'}
get({a: {b: 'c', c: {d: 'e', e: 'f', g: {h: 'i'}}}}, 'a.c.g.h');
//=> {h: 'i'}
Install with npm
npm i get-property --save
Install with bower
bower install get-property --save
npm test
Jon Schlinkert
Copyright (c) 2014 Jon Schlinkert, contributors.
Released under the MIT license
This file was generated by verb-cli on October 08, 2014.