View difference between Paste ID: ddm1J6UM and 0Ws6AD2x
SHOW: | | - or go back to the newest paste.
1
function resetToDefault(current, defaults) {
2
  for(var prop in current) {
3
    if(current.hasOwnProperty(prop)) {
4
      if(defaults.hasOwnProperty(prop)) {
5-
       current[prop] = defaults[prop];
5+
        current[prop] = defaults[prop];
6
      } else {
7
        delete current[prop];
8
      }
9
    }
10
  }
11
}