📜  重置值对象 js - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:52.998000             🧑  作者: Mango

代码示例1
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
    }
}