code: function resolve(obj, propstr, default_val){
         // special case, no test and assignment needed for optional default_val;  we don't mind if default_val is undefined!
         // note: eval called on propstr!
         var rv;
  
         if(obj === undefined){
             rv =  default_val;
         } else if(obj.hasOwnProperty(propstr)) {
             rv =  obj[propstr];
         } else {
             //treat [] as index 0
             propstr = propstr.replace(/\[\]/g,'[0]');
             // try drilling down complex propstr like 'foo.bar.quux' or array.
             try {
               //eval like this to enable "with {}" in strict mode (for babel compatibility)
               rv = (new Function( "with(this) { return " + propstr + "}")).call(obj);
             } catch(e) {
                 rv = undefined;
             }
         }
         return (rv === undefined ) ? default_val : rv;
     }
docs: return value of property in object.