var object1 = {\r\n apple: 0,\r\n banana: { weight: 52, price: 100 },\r\n cherry: 97\r\n};\r\nvar object2 = {\r\n banana: { price: 200 },\r\n durian: 100\r\n};\r\n \r\n// Merge object2 into object1\r\n$.extend( object1, object2 );\r\n \r\n// Assuming JSON.stringify - not available in IE<8\r\n$( \"#log\" ).append( JSON.stringify( object1 ) );

$.extend jquery

Similar Code Examples