当前位置:网站首页>js的arguments
js的arguments
2022-06-25 04:00:00 【刘家奕_】
目录
(2)arguments.length可以用来获取实参的长度
(1)在调用函数时,浏览器每次都会传递进两个隐含的参数;
1.函数的上下文对象this
2.封装实参的对象arguments
(1)验证是否存在arguments
<script>
function fun() {
console.log(arguments);
}
fun();
</script>
所以存在;
- arguments是一个类数组对象,它也可以通过索引来操作数据,也可以获取长度
-在调用函数时,我们所传递的实参都会在arguments中保存
类数组对象:我们来验证它不是数组(两种方法)
<script>
function fun() {
console.log(arguments instanceof Array);
console.log(Array.isArray(arguments));
// console.log(arguments.length);
}
fun();
</script>
明显不是数组--------而是类数组
(2)arguments.length可以用来获取实参的长度
<script>
function fun() {
console.log(arguments.length);
}
fun("刘", "家", "奕");
</script>
-我们即使不定义形参,也可以通过arguments来使用实参,
只不过比较麻烦
arguments[0]表示第一个实参
arguments[1]表示第二个实参........
(3)它里边有一个属性叫做callee
这个属性对应一个函数对象,就是当前正在指向的函数的对象
<script>
function fun() {
console.log(arguments.callee == fun);
}
fun();
</script>
边栏推荐
- GBASE 8s的数据视图
- Nodejs connects to MySQL through heidisql, and ER appears_ BAD_ DB_ ERROR: Unknown database 'my_ db_ books'
- cnpm : 无法加载文件 C:\Users\Administrator\AppData\Roaming\npm\cnpm.ps1,因为在此系统上禁止运行脚本。
- Thorough understanding of database transactions
- GBASE 8s存儲過程語法結構
- GBASE 8s 索引B+树
- Laravel document sorting 7. View
- Unity Quad culls shaders with back faces and transparent parts
- Office macro virus bounce shell experiment
- GBASE 8s中DELIMIDENT环境变量的使用
猜你喜欢

单元测试覆盖率

Nodejs connects to MySQL through heidisql, and ER appears_ BAD_ DB_ ERROR: Unknown database 'my_ db_ books'

What is the storage engine and the three common database storage engines for MySQL

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

Nodejs 通过Heidisql连接mysql出现ER_BAD_DB_ERROR: Unknown database 'my_db_books'

Can Navicat directly operate the Android database SQLite

js中的concat()

CTF_ Web: how to recognize and evaluate a regular expression

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

CTF_ Web: Advanced questions of attack and defense world expert zone WP (1-4)
随机推荐
什么是持久化?redis 持久化中的RDB和AOF是什么?
What is persistence? What are RDB and AOF in redis persistence?
UCLA | generative pre training for black box optimization
2020.3.3 notes async/await and promise and Then processes and threads
LabVIEW开发气体调节器
mongodb集群
微信小程序父子组件之间传值
Lecture record: history and development of strapdown inertial navigation solution
GBASE 8s的触发器
Basic introduction of gbase 8s blocking technology
js中的concat()
Solution of gbase 8s livelock and deadlock
i. Max development board learning record
Leetcode points to the leetcode road of offering II 091 house painting [dynamic planning] heroding
Detailed explanation of flex attributes in flex layout
sql_ mode=only_ full_ group_ By's pit
515. 在每个树行中找最大值 / 剑指 Offer II 095. 最长公共子序列
Numpy NP tips: use OpenCV to interpolate and zoom the array to a fixed shape cv2 resize(res, dsize=(64, 64), interpolation=cv2. INTER_ CUBIC)
Classification of gbase 8s locks
EasyRecovery15非常好用的电脑数据恢复软件