qiudeqing
  1. 函数中通过arguments可以访问所有实参
  2. 在非严格模式下arguments为形参的一个别名,  ecmascript 5中移除了这个特性
    1 function f(x)
    2 {
    3   console.log(x); // x
    4   arguments[0] = null;
    5   console.log(x); // null
    6 } // end f()

     

  3. 在非严格模式下arguments只是一个标识符,   在严格模式下成为保留字,   所以严格模式下的函数不能使用arguments作为形参名称或局部变量名,  也不能给arguments赋值
  4. arguments定义了callee和caller属性,   在ecmascript 5严格模式下对这两个属性的读写都会产生类型错误,   在非严格模式下ecmascript表中规范规定callee只带当前正在执行的函数,   caller是非标准的但是大多数浏览器都实现了这个属性,  用于指代调用当前执行函数的函数

分类:

技术点:

相关文章:

  • 2021-09-05
  • 2022-12-23
  • 2021-06-03
  • 2021-03-31
  • 2021-09-10
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-05
  • 2022-12-23
  • 2022-12-23
  • 2021-08-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案