当前位置:网站首页>JS arguments parameter usage and explanation
JS arguments parameter usage and explanation
2022-07-04 05:41:00 【Tianma 3798】
One 、arguments Parameter Introduction
arguments, It is js An object built into a function in , The values of the actual parameters of the execution function method are stored in arguments in ;
To get these arguments , It needs to be like an array , Use subscript / Index to locate each value , But it can't be said to be an array , Because it has other properties , Such as callee;
And you can't use it shift、push、join Other methods .
Named parameters that do not pass values are automatically assigned undefined;
arguments.length---- Number of parameters
arguments.callee()--- Adjust the Commission itself
Two 、 Use cases
Case study 1:
function show() {
console.info(arguments);
//arguments.callee()
}
show();
show(1, 2);
show(window, 1)
Case study 2:
function sum() {
var result = 0;
for (
边栏推荐
- 拓扑排序和关键路径的图形化显示
- Graduation design of small programs -- small programs of food and recipes
- Actual cases and optimization solutions of cloud native architecture
- How to configure static IP for Kali virtual machine
- [high concurrency, high performance and high availability of massive data MySQL practice-7] - memory data drop disk
- Kubernets first meeting
- SQL performance optimization skills
- Flask
- Risc-v-qemu-virt in FreeRTOS_ Lock mechanism analysis of GCC
- 十二. golang其他
猜你喜欢
The data mark is a piece of fat meat, and it is not only China Manfu technology that focuses on this meat
BUU-Crypto-[GXYCTF2019]CheckIn
Programmers don't talk about morality, and use multithreading for Heisi's girlfriend
Integer type of C language
如何展开Collapse 的所有折叠面板
1480. Dynamic sum of one-dimensional array
BUU-Pwn-test_ your_ nc
Kubernets first meeting
Upper computer software development - log information is stored in the database based on log4net
Kubernets first meeting
随机推荐
Zhanrui tankbang | jointly build, cooperate and win-win zhanrui core ecology
Online shrimp music will be closed in January next year. Netizens call No
[wechat applet] template and configuration (wxml, wxss, global and page configuration, network data request)
Integer type of C language
XII Golang others
补某视频网站的js,进行视频解密
win10清除快速访问-不留下痕迹
transformer坑了多少算力
Programmers don't talk about morality, and use multithreading for Heisi's girlfriend
Thread pool: use thread pool to optimize query speed
Arc135 a (time complexity analysis)
509. 斐波那契数、爬楼梯所有路径、爬楼梯最小花费
C # character similarity comparison general class
Flask
十二. golang其他
What is MQ?
ansys命令
LM小型可编程控制器软件(基于CoDeSys)笔记二十二:错误4268/4052
el-select如何实现懒加载(带搜索功能)
Upper computer software development - log information is stored in the database based on log4net