var constantize = (obj)=>{
Object.freeze(obj);
Object.keys(obj).forEach(key, i)=>{
if(typeof obj[key] === 'object'){
constantize(obj[key])
}
}
}
var constantize = (obj)=>{
Object.freeze(obj);
Object.keys(obj).forEach(key, i)=>{
if(typeof obj[key] === 'object'){
constantize(obj[key])
}
}
}
本文标题:const 对象数组的冻结
本文链接:https://www.haomeiwen.com/subject/tjcksqtx.html
网友评论