1for (var key in current){
2 if (current.hasOwnProperty(key)){
3 if (typeof current[key] === 'string'){
4 current[key] = undefined;
5 } else if (current[key] instanceof Array) {
6 current[key] = [];
7 } // else ??? Not sure how you want to handle other types
8 }
9}