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
3,532
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'`