huoxiangdong / Blog

学习记录
0 stars 0 forks source link

变量锁 #54

Open huoxiangdong opened 6 years ago

huoxiangdong commented 6 years ago
// 使用标志量
 if(state <= 1) {
    state++
     left = el.getBoundingClientRect().left
     top = el.getBoundingClientRect().top
 }
// Object.freeze
var obj = { greeting : "Hi!" };
Object.freeze(obj);
Object.isFrozen(obj);