当前位置:网站首页>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>
边栏推荐
- Use of deferred environment variable in gbase 8s
- 机器学习深度学习——向量化
- Gbase 8s stored procedure execution and deletion
- A detailed summary of TCP connection triple handshake
- Structure syntaxique des procédures stockées gbase 8S
- Lecture record: data processing methods and applications of various spatial geodetic techniques
- Basic introduction of gbase 8s blocking technology
- Xiaobai learns MySQL - Statistical 'opportunism'
- CTF_ Web: advanced problem WP (5-8) of attack and defense world expert zone
- OOP栈类模板(模板+DS)
猜你喜欢

Part I Verilog quick start

Basic use of OBS browser+ browser

mongodb集群

Finereport (sail soft) handling the problem that the histogram data label is blocked

EasyRecovery15非常好用的电脑数据恢复软件

GBASE 8s 总体架构

论文笔记: 多标签学习 ESMC (没看懂, 还没写出来, 暂时放这里占个位置)

Coinlist how to operate the middle lot number security tutorial

Xiaobai learns MySQL - Statistical 'opportunism'

js的sort()函数
随机推荐
GBASE 8s的并行操作问题场景描述
Gbase 8s stored procedure syntax structure
Laravel document sorting 4. Controller
Basic use of OBS browser+ browser
Win10 environment phpstudy2016 startup failure record
SQL injection details
GbASE 8s中的Blob 页(Blobspace page)
Laravel document sorting 1. Installation and Preliminary Configuration
《牛客刷verilog》Part I Verilog快速入门
GBASE 8s存储过程语法结构
OBS Browser+浏览器的基本使用
Xiaobai learns MySQL - Statistical 'opportunism'
GBASE 8s 索引B+树
彻底理解数据库事务
什么是数据持久化?
Laravel document sorting 6. Response
Le chemin de l'apprentissage immutable - - Adieu à la copie traditionnelle
LabVIEW development gas regulator
Laravel document sorting 9. Blade template
GBase 8s 锁的分类