当前位置:网站首页>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>
边栏推荐
- Multithreading structure of gbase 8s
- 三角形类(构造与析构)
- CTF_ Web: basic 12 questions WP of attack and defense world novice zone
- Finereport (sail soft) handling the problem that the histogram data label is blocked
- Cascading deletion of gbase 8s
- 关于TCP连接三次握手的详细总结
- kenlm
- 使用文本分析识别一段文本中的主要性别
- Laravel document sorting 2. Route related
- PHP extracts and analyzes table contents, and collects bidding information
猜你喜欢

A detailed summary of four handshakes (or four waves) over TCP connections

Read lsd-slam: large scale direct monolithic slam

机器学习深度学习——向量化

我的IC之旅——资深芯片设计验证工程师成长——“胡”说IC工程师完美进阶

深度学习——几种学习类型

Cnpm: unable to load file c:\users\administrator\appdata\roaming\npm\cnpm PS1 because running scripts is prohibited on this system.

English Grammar - pronunciation rules

【esp32学习之路6——flash加密】

微信小程序父子组件之间传值

Summary of various problems encountered by cocos2d-x
随机推荐
Gbase 8s index R tree
第二十五周记录
CTF_ Web: advanced problem WP (5-8) of attack and defense world expert zone
A detailed summary of TCP connection triple handshake
Lecture record: data processing methods and applications of various spatial geodetic techniques
Blob page in gbase 8s
GBASE 8s的并行操作问题场景描述
我的IC之旅——资深芯片设计验证工程师成长——“胡”说IC工程师完美进阶
OOP栈类模板(模板+DS)
Win10 environment phpstudy2016 startup failure record
php封装curl发送get、post请求方法,并使用
i. Max development board learning record
CTF_ Web: file contains pseudo protocol with PHP
Multithreading structure of gbase 8s
CTF_ Web: Advanced questions of attack and defense world expert zone WP (9-14)
Smart contract learning materials
LeetCode 劍指Offer II 091 粉刷房子[動態規劃] HERODING的LeetCode之路
GBASE 8s存储过程执行和删除
2.0SpingMVC使用RESTful
kenlm