8)arguments

例 3.8.1
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
</head>
<script>
    /*  马克-to-win:when there are n functions with the same function name, only the last one is used.  */
    function test()
    {
        document.writeln("no argument constructor.");
    }
    function test(person)
    {
        document.writeln("马克-to-win2");
        /*Function.arguments[] (Collection) The values passed to the function when it is called.
        马克-to-win: inside function,we can directly use arguments.
        */
        var n = arguments.length;
        document.writeln("n is " + n);
        for (var i = 0; i < n; i++)
        {
            document.writeln("马克-to-win3");
            document.writeln(arguments[i])
        }
        document.writeln(person);
        document.writeln(typeof(person) + "is typeof");
    }
    /*when no param, undefined is passed in. no overloaded function concept.*/
    test();
    /*when there is no this function, program stops here.*/
    change();
    document.writeln("finally");
</script>

转载自:https://blog.csdn.net/qq_44594249/article/details/100091795

最新文章

  1. 关于.NET参数传递方式的思考
  2. Windows无法完成安装,若要在此计算机上安装Windows,请中心启动安装。
  3. OpenSceneGraph 笔记--如何导出三角形数据
  4. (3)JSTL的fn方法库
  5. 二十九、EFW框架开发的系统支持SaaS模式和实现思路
  6. [前端]npm安装慢,换用淘宝的镜像
  7. Retention、Documented、Inherited三种注解
  8. 【单调栈】Bzoj 1012: 最大数maxnumber
  9. BZOJ 1028: [JSOI2007]麻将 暴力
  10. 理解sparse coding
  11. SPI介绍
  12. linux shell pushd popd dirs命令
  13. SQL Server MySQL 中的 in 与 null
  14. codeforces 242E. XOR on Segment 线段树
  15. FlowLayoutPanel 内的控件怎么调换顺序?
  16. Oracle数据库和客户端字符集
  17. 改动hosts权限
  18. Vue2.0 相对于Vue1.0的变化:生命周期
  19. console.log 用法
  20. java基础(十五)----- Java 最全异常详解 ——Java高级开发必须懂的

热门文章

  1. Go语言实现:【剑指offer】包含min函数的栈
  2. Java开发最佳实践(二) ——《Java开发手册》之&quot;异常处理、MySQL 数据库&quot;
  3. 安装 Cacti 监控
  4. 多校二 1003Maximum Sequence 模拟
  5. C#基础知识学习(2)string类中的方法
  6. hexo博客
  7. clr via c# 运行时序列化
  8. git系列之---码云gitee 添加SHH公钥
  9. O2O外卖玩众包 开放平台难解标准之痛
  10. 在Idea中jdk11和jdk8环境变量的切换