Skip to content
append properties from one object to another https://npmjs.org/package/append
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.npmignore
LICENSE.mkd
README.mkd
append.js
package.json
test.js

README.mkd

append one object to another.

append(obj1, obj2)

Example

var a = {
    name: "a",
    width: 90,
    height: 70
};

var b = {
    name: "b",
    length: 6
};

console.log(append(a, b));

This will print

{ name: 'b', width: 90, height: 70, length: 6 }

As you can see, existing properties are getting replaced.

Something went wrong with that request. Please try again.