Ver Mensaje Individual
  #4 (permalink)  
Antiguo 27/10/2010, 03:09
Avatar de stock
stock
 
Fecha de Ingreso: junio-2004
Ubicación: Monterrey NL
Mensajes: 2.390
Antigüedad: 19 años, 10 meses
Puntos: 53
Respuesta: Sincronizar objetos

Simplemente sobre escribes los valor por default y listo.

Código Javascript:
Ver original
  1. var App = {}
  2.  
  3. App.Foo : function(config){
  4.        var options = {valDefault:1,.....};
  5.        config = config || {};
  6.        
  7.        for(var key in config){
  8.            options[key] = config[key];
  9.        }
  10. };
  11.  
  12.  
  13. var f = new App.Foo({valNuevo:3,.....});


Saludos :)