Answers for "reset value object js"

0

reset value object js

for (var key in current){
    if (current.hasOwnProperty(key)){
        if (typeof current[key] === 'string'){
            current[key] = undefined;
        } else if (current[key] instanceof Array) {
            current[key] = [];
        } // else ???  Not sure how you want to handle other types
    }
}
Posted by: Guest on December-22-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language