You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functiondeepFreeze(o){varprop,propKey;Object.freeze(o);// First freeze the object.for(propKeyino){prop=o[propKey];if(!o.hasOwnProperty(propKey)||!(typeofprop==='object')||Object.isFrozen(prop)){// If the object is on the prototype, not an object, or is already frozen,// skip it. Note that this might leave an unfrozen reference somewhere in the// object if there is an already frozen object containing an unfrozen object.continue;}deepFreeze(prop);// Recursively call deepFreeze.}}
The text was updated successfully, but these errors were encountered:
Test:
Solution use deep freeze:
The text was updated successfully, but these errors were encountered: