adamisntdead / obj-value

Safely access javascript property values

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

obj-value

Safely access javascript object values NpmVersion

Usage

First you need to install:

$ npm install obj-value

Then you can use it in your program:

const get = require('obj-value')

const obj = { a: { b: { c: 'd' } } }

get(obj, 'a.b.c') // returns 'd'
get(obj, 'a.b.d') // returns `null`

License

MIT

About

Safely access javascript property values


Languages

Language:JavaScript 100.0%