setKeyValue
Set the value of a named property on a MapLike object.
setKeyValue(obj, key, value)
Set the property on Map-like obj
, identified by the String, Symbol or Object value key
, to the value value
.
The default behavior can be overridden on obj
by implementing @@can.setKeyValue,
otherwise native named property access is used for string keys, and Object.defineProperty
is used to set symbols.
var foo = new DefineMap({ bar: "baz" });
canReflect.setKeyValue(foo, "bar", "quux");
foo[bar]; // -> "quux"
Parameters
- obj
{Object}
:the object to set on
- key
{String}
:the key for the property to set
- value
{*}
:the value to set on the object