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