参考:

(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  
}

 js的width函数

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

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-06
  • 2021-10-27
  • 2022-01-14
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-26
  • 2022-12-23
  • 2021-08-23
  • 2022-02-16
  • 2021-04-10
相关资源
相似解决方案