can-assign
A simplified version of Object.assign, which only accepts a single source argument.
assign(target, source)
Parameters
- target
{Object}:The destination object. This object's properties will be mutated based on the object provided as
source. - source
{Object}:The source object whose own properties will be applied to
target.
Returns
{Object}:
Returns the target argument.
var assign = require("can-assign");
var obj = {};
assign(obj, {
foo: "bar"
});
console.log(obj.foo); // -> "bar"