zoukankan      html  css  js  c++  java
  • arguments 属性(函数)(JavaScript)

    转载:http://msdn.microsoft.com/zh-cn/library/he95z461(v=vs.94).aspx

    获取当前正在执行的 Function 对象的参数。

    function.arguments

    备注

    function 参数是当前正在执行的函数的名称,且可以省略。

    此属性使函数可以处理可变数量的参数。 arguments 对象的 length 属性包含了传递给函数的参数数目。 arguments 对象中包含的各个参数的访问方式与数组元素的访问方式相同。

    示例

    下面的示例阐释了 arguments 属性的用法:

     1 function ArgTest(arg1, arg2){
     2    var s = "";
     3    s += "The individual arguments are: "
     4    for (n = 0; n < arguments.length; n++){
     5       s += ArgTest.arguments[n];
     6       s += " ";
     7    }
     8    return(s);
     9 }
    10 console.log(ArgTest(1, 2, "hello"));
    11 // The individual arguments are: 1 2 hello

    要求

    在以下文档模式中受支持:Quirks、Internet Explorer 6 标准模式、Internet Explorer 7 标准模式、Internet Explorer 8 标准模式、Internet Explorer 9 标准模式、Internet Explorer 10 标准模式和 Internet Explorer 11 标准模式。此外,也在应用商店应用(Windows 8 和 Windows Phone 8.1)中受支持。

  • 相关阅读:
    Redis 简介
    图片懒加载、selenium和PhantomJS
    Python网络爬虫之三种数据解析方式
    Scrapy框架之CrawlSpider
    Scrapy 框架
    python 网络爬虫概念与HTTP(s)协议
    Mysql概念及基本操作
    Python re 模块
    线程与进程应用场景
    全局解释器锁 GIL
  • 原文地址:https://www.cnblogs.com/johnnylion/p/3937477.html
Copyright © 2011-2022 走看看