for (attrname in obj2) { obj1[attrname] = obj2[attrname]; }
If you're using a framework that shits all over your prototypes then you have to get fancier with checks like hasOwnProperty, but that code will work for 99% of cases.