Jquery extend function

This is somehow good when extend data and overwrite

var object1 = {
apple: 0,
banana: { weight: 52, price: 100 },
cherry: 97
};
var object2 = {
banana: { price: 200 },
durian: 100
};
// Merge object2 into object1
$.extend( object1, object2 ); object1 data {"apple":0,"banana":{"price":200},"cherry":97,"durian":100}

Comments

Popular posts from this blog

Project euler 169 found clue

Floyd-Warshall's algorithm