lunes, 16 de marzo de 2015

javascript: mezclando Objetos


function merge_options(obj1,obj2){
    var obj3 = {};
    for (var attrname in obj1) { obj3[attrname] = obj1[attrname]; }
    for (var attrname in obj2) { obj3[attrname] = obj2[attrname]; }
    return obj3;
}

http://jsfiddle.net/ric47121/dwewcoam/

No hay comentarios:

Publicar un comentario