-
Notifications
You must be signed in to change notification settings - Fork 0
extend
Mike Byrne edited this page Mar 7, 2018
·
3 revisions
Merges the contents of two objects together
- nothing
- any number of objects
- merged object
var obj1 = { foo: 1 };
var obj2 = { bar: 2 };
var obj3 = { qux: 3 };
var merged_obj = extend(obj1,obj2); // { foo: 1, bar: 3, qux: 3 }
var obj1 = { foo: "bar", qux: "foobar" };
var obj2 = { foo: "baz" };
var merged_obj = extend(obj1,obj2); // { foo: "baz", qux: "foobar" }