js的width函数

参考:

(1)https://blog.csdn.net/chen__jinfei/article/details/6520678

(2)https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/with

with函数,用法:

var 对象 = {
  key:value,
  func: function(){}
}

width(对象){
  alert(key); // 对象.key
  func();  // 对象.func  
}

 

with函数es5中就可用,es5的严格模式不可用

原文地址:https://www.cnblogs.com/molinglan/p/8698309.html