当前位置:网站首页>js arguments参数使用和详解
js arguments参数使用和详解
2022-07-04 05:29:00 【天马3798】
一、arguments 参数介绍
arguments,它是js中函数内置的一个对象,而执行函数方法的实参中值都存储在arguments中;
要想获取到这些实参,就需要像数组一样,用下标/索引来定位到每个值上面,但是又不能说它是一个数组,因为它里面还有其他的属性,如callee;
并且不能对它使用shift、push、join等方法。
而没有传递值的命名参数将会被自动赋予undefined;
arguments.length----参数个数
arguments.callee()---调佣自身
二、使用案例
案例1:
function show() {
console.info(arguments);
//arguments.callee()
}
show();
show(1, 2);
show(window, 1)
案例2:
function sum() {
var result = 0;
for (边栏推荐
- 2022G2电站锅炉司炉特种作业证考试题库及答案
- [high concurrency, high performance and high availability of massive data MySQL practice-7] - memory data drop disk
- Signification des lettres du module optique et abréviation des paramètres Daquan
- Basic concept of bus
- Introduction to AMBA
- BUU-Crypto-Cipher
- TCP state transition diagram
- Actual cases and optimization solutions of cloud native architecture
- Introduction To AMBA 简单理解
- Analysis of classical pointer and array written test questions in C language
猜你喜欢

BUU-Pwn-test_ your_ nc

VB. Net GIF (making and disassembling - optimizing code, class library - 5)

2022G2电站锅炉司炉特种作业证考试题库及答案

数据标注是一块肥肉,盯上这块肉的不止中国丨曼孚科技

HMS v1.0 appointment.php editid参数 SQL注入漏洞(CVE-2022-25491)

企业级日志分析系统ELK(如果事与愿违那一定另有安排)

Just do it with your hands 7 - * project construction details 2 - hook configuration

The data mark is a piece of fat meat, and it is not only China Manfu technology that focuses on this meat

Accidentally deleted the data file of Clickhouse, can it be restored?

KMP match string
随机推荐
VB.net GIF(制作、拆解——优化代码,类库——5)
LM小型可编程控制器软件(基于CoDeSys)笔记二十一:错误3703
How much computing power does transformer have
Flask
c语言经典指针和数组笔试题解析
Electronic components mall and data manual download website summary
Signification des lettres du module optique et abréviation des paramètres Daquan
Flink1.13 SQL basic syntax (I) DDL, DML
C语言简易学生管理系统(含源码)
2022危险化学品经营单位安全管理人员上岗证题库及答案
Thread pool: use thread pool to optimize query speed
Arc135 a (time complexity analysis)
C language simple student management system (including source code)
Principle and practice of common defects in RSA encryption application
How to clone objects
Zzulioj:1201: mode problem
transformer坑了多少算力
2022 question bank and answers for safety management personnel of hazardous chemical business units
SQL injection - injection based on MSSQL (SQL Server)
LabVIEW错误对话框的出现