object-assign Build Status

ES6 Object.assign() ponyfill

I would love for this to be a fully compliant polyfill, but I have no idea how to read the ES6 spec. Help appreciated :)

Ponyfill: An almost conforming polyfill which doesn't overwrite the native method

Install

Download manually or with a package-manager.

npm

npm install --save object-assign

Bower

bower install --save object-assign

Component

component install sindresorhus/object-assign

Example

objectAssign({foo: 0}, {bar: 1});
//=> {foo: 0, bar: 1}

// multiple sources
[{bar: 1}, {baz: 2}].reduce(objectAssign, {foo: 0});
//=> {foo: 0, bar: 1, baz: 2}

API

objectAssign(target, source)

Assigns enumerable own properties of the source object to the target object and returns the target object.

License

MIT © Sindre Sorhus