当前位置:网站首页>JS arguments
JS arguments
2022-06-25 04:36:00 【Liujiayi_】
Catalog
(1) When the function is called , The browser passes in two implicit parameters at a time ;
(1) Verify that... Exists arguments
(2)arguments.length It can be used to get the length of arguments
(3) It has an attribute called callee
(1) When the function is called , The browser passes in two implicit parameters at a time ;
1. The context object of the function this
2. The object that encapsulates the argument arguments
(1) Verify that... Exists arguments
<script>
function fun() {
console.log(arguments);
}
fun();
</script>
So there is ;
- arguments It's a Class array object , It can also manipulate data through indexes , You can also get the length
- When the function is called , All the arguments we pass will be in arguments Kept in
Class array object : Let's verify that it's not an array ( The two methods )
<script>
function fun() {
console.log(arguments instanceof Array);
console.log(Array.isArray(arguments));
// console.log(arguments.length);
}
fun();
</script>
Obviously not an array -------- It's an array of classes
(2)arguments.length It can be used to get the length of arguments
<script>
function fun() {
console.log(arguments.length);
}
fun(" Liu ", " home ", " yi ");
</script>
- Even if we don't define formal parameters , It can also be done through arguments To use arguments ,
Just more trouble
arguments[0] Represents the first argument
arguments[1] Represents the second argument ........
(3) It has an attribute called callee
This property corresponds to a function object , Is the object of the function that you are currently pointing to
<script>
function fun() {
console.log(arguments.callee == fun);
}
fun();
</script>
边栏推荐
- Musk released humanoid robot. Why is AI significant to musk?
- Gbase 8s parallel operation problem scenario description
- GBASE 8s 总体架构
- GBASE 8s的数据导入和导出
- Unit test coverage
- Value transfer between parent and child components of wechat applet
- 我的IC之旅——资深芯片设计验证工程师成长——“胡”说IC工程师完美进阶
- 什么是持久化?redis 持久化中的RDB和AOF是什么?
- Should I use on or where for the left join
- Communication problems in parent and child components of uniapp
猜你喜欢
CTF_ Web: basic 12 questions WP of attack and defense world novice zone
Anaconda installation +tensorflow installation +keras installation +numpy installation (including image and version information compatibility issues)
A detailed summary of four handshakes (or four waves) over TCP connections
CTF_ Web: Advanced questions of attack and defense world expert zone WP (1-4)
What is the storage engine and the three common database storage engines for MySQL
Simple text analysis of malicious samples - Introduction
OBS Browser+浏览器的基本使用
单元测试覆盖率
【无标题】
小白学习MySQL - 统计的'投机取巧'
随机推荐
Laravel document sorting 7. View
Musk released humanoid robot. Why is AI significant to musk?
cnpm : 无法加载文件 C:\Users\Administrator\AppData\Roaming\npm\cnpm.ps1,因为在此系统上禁止运行脚本。
GBASE 8s中DELIMIDENT环境变量的使用
LabVIEW开发气体调节器
CTF_ Web: how to recognize and evaluate a regular expression
2021.6.14 notes
BSC smart contract dividend mainstream currency | including marketing wallet | deflation | reflow | dividend free token | available for direct deployment
Blob page in gbase 8s
STM32的DMA双缓冲模式详解
2.0SpingMVC使用RESTful
Cnpm: unable to load file c:\users\administrator\appdata\roaming\npm\cnpm PS1 because running scripts is prohibited on this system.
Lecture record: data processing methods and applications of various spatial geodetic techniques
GBASE 8s存储过程流程控制
CTF_ Web:8-bit controllable character getshell
Comparison of towe/ JIRA / tapd / Zen collaboration platforms
EasyRecovery15非常好用的电脑数据恢复软件
Anaconda installation +tensorflow installation +keras installation +numpy installation (including image and version information compatibility issues)
CTF_ Web: Advanced questions of attack and defense world expert zone WP (1-4)
CTF_ Web: deserialization of learning notes (II) CTF classic test questions from shallow to deep