function deepConst(data){ Object.freeze(data); for(let key in data){ let prop = data[key]; if(!data.hasOwnProperty(key) || !(typeof prop === "object") || Object.isFrozen(prop)){ continue; } deepConst(prop); } }
function deepConst(data){ Object.freeze(data); for(let key in data){ let prop = data[key]; if(!data.hasOwnProperty(key) || !(typeof prop === "object") || Object.isFrozen(prop)){ continue; } deepConst(prop); } }