Advertisement
Guest User

Untitled

a guest
Sep 17th, 2015
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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];
  6.       } else {
  7.         delete current[prop];
  8.       }
  9.     }
  10.   }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement