标签:OLE change opp ring 对象 nbsp top console span
冻结对象:
var pizza = { name: ‘Peri Peri‘, Topping: ‘Prawn‘ }; Object.freeze(pizza); // Can‘t change the name of the object because it‘s frozen pizza.name = ‘Hawaiian‘;
解冻对象:
var pizza = { name: ‘Peri Peri‘, Topping: ‘Prawn‘ }; Object.freeze(pizza); pizza.name = ‘Hawaiian‘; console.log(pizza); // { name: ‘Peri Peri‘, Topping: ‘Prawn‘ } pizza = JSON.parse(JSON.stringify(pizza)); // Clones the object pizza.name = ‘Hawaiian‘; console.log(pizza); // { name: ‘Hawaiian‘, Topping: ‘Prawn‘ }
标签:OLE change opp ring 对象 nbsp top console span
原文地址:https://www.cnblogs.com/webljl/p/14355714.html