Skip to content
Mike Byrne edited this page Mar 7, 2018 · 3 revisions

extend

description

Merges the contents of two objects together

requires

  • nothing

parameters

  • any number of objects

returns

  • merged object

example usage:

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" }