$.extend()
Syntax
$.extend([recursive, ][target, ]properties [, propertiesN])
Parameters
recursive (optional)
- A Boolean indicating whether to merge objects within objects
target (optional)
- An object that will receive the new properties
properties
- An object containing additional properties to merge in
propertiesN
- Additional objects containing properties to merge in
Return value
The target object after it has been modified.
Description
Merge the contents of two objects together into the first object.
var t1 = {
a: 0,
b: {x: 5, y: 100},
c: 7
};
var t2 = {
b: {p: 2},
d: 1
};
var object = $.extend(t1, t2);