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

0.8.1 • 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

/get-object-value/

    Package Sidebar

    Install

    npm i get-object-value

    Weekly Downloads

    359

    Version

    0.8.1

    License

    MIT

    Unpacked Size

    23.9 kB

    Total Files

    44

    Last publish

    Collaborators

    • hillliu