code: function restore(fn, obj) {
    var props = new Array(arguments.length - 2)
    var vals = new Array(arguments.length - 2)
  
    for (var i = 0; i < props.length; i++) {
      props[i] = arguments[i + 2]
      vals[i] = obj[props[i]]
    }
  
    return function(){
      // restore vals
      for (var i = 0; i < props.length; i++) {
        obj[props[i]] = vals[i]
      }
  
      return fn.apply(this, arguments)
    }
  }
docs: Restore obj props after function
  
  @private