美文网首页
函数的arguments

函数的arguments

作者: KATENGC | 来源:发表于2020-04-21 15:08 被阅读0次
function foo(x,y,z){
  //‘use strict’; //在严格模式下,对arguments[0]赋值不会生效,仍为1;同时callee不能调用

  console.log(arguments.length);// 2 实参个数
  console.log(arguments[0]);// 1
  arguments[0]=10;// 改成10
  console.log(arguments[0]);// 10
  console.log(z);// undefined

  console.log(arguments.callee===foo);// true
}

foo(1,2);
//foo.name--函数名
console.log(foo.name);// foo
//foo.length--形参个数
console.log(foo.length);// 3 

相关文章

  • JavaScript基础 - js对象和绑定对象事件

    arguments是函数中的隐含对象通过arguments[0]、arguments[1]可以获得函数的参数arg...

  • 关于JS中的arguments、caller 和 callee

    arguments arguments: 在函数调用时, 会自动在该函数内部生成一个名为 arguments的隐...

  • 10/12 js小总结

    1.arguments[] 在函数体中arguments指代该函数的Arguments对象,在全局中为undefi...

  • 过程记录

    了解arguments 特性:arguments对象不能显式创建,arguments对象只有函数开始时才可用。函数...

  • js中arguments的用法

    arguments特性arguments对象不能显式创建,arguments对象只有函数开始时才可用。函数的 ar...

  • js中arguments的用法

    arguments特性 **arguments **对象不能显式创建, **arguments **对象只有函数开...

  • Arguments

    arguments 函数参数数组,他只定义在函数体中,函数体中arguments指代该函数的Argument对象。...

  • 2018-11-22 关于 arguments.callee

    arguments.callee 函数内, 有两个特殊对象: arguments 和 this arguments...

  • javaScript 基础 04

    函数 1.arguments arguments JavaScript还有一个免费赠送的关键字arguments,...

  • 02-JavaScript

    一、基础 1.函数的arguments 其实Javascript并没有重载函数的功能,但是Arguments对象能...

网友评论

      本文标题:函数的arguments

      本文链接:https://www.haomeiwen.com/subject/eyiuihtx.html