set-prop-get-value
v1.1.0
Published
set a new property in a js object and return the value of the given property
Downloads
2,749
Readme
set-prop-get-value
set a new property in a js object and return the value of the given property
api
const setProp = require('set-prop-get-value')
setProp(object, prop_name, prop_value)
example
const setProp = require('set-prop-get-value')
let someObject = {}
setProp(someObject, 'hello', 'world')
// should return `world`
// and now `someObject` should have the new prop `hello: 'world'`