reset value object js

Solutions on MaxInterview for reset value object js by the best coders in the world

showing results for - "reset value object js"
Alexander
05 Jan 2020
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}