get-object-value
TypeScript icon, indicating that this package has built-in type declarations

0.6.9 • Public • Published

Get object value with paht

Spec


import get from 'get-object-value';

get(object, path, defaultValue)

Example Usage


import get from 'get-object-value';

let demoObject = {
  a: {
    b: c1
  }
};

let v1 = get(demoObject, ['a','b']); // return c1

let v1 = get(demoObject, ['a','b','d'], 'c2'); // return c2

Set Object Value

Loadash

Dependents (37)

Package Sidebar

Install

npm i get-object-value

Weekly Downloads

948

Version

0.6.9

License

MIT

Unpacked Size

20.2 kB

Total Files

40

Last publish

Collaborators

  • hillliu