当前位置:网站首页>JS call() and apply()
JS call() and apply()
2022-06-25 04:36:00 【Liujiayi_】
call() and apply()
- Both methods are methods of function objects , You need to call... Through a function object
- When calling a function call() and apply() Will call the function to execute
- Calling call() and apply() You can specify an object as the first parameter
At this point, the object will become the object of the function execution this
- call() Method can pass the arguments after the object in turn
- apply() Method needs to encapsulate the arguments into an array and pass them uniformly
- this The situation of :
1. When called as a function ,this It's always window
2. When called as a method ,this It's the object that calls the method
3. When called as a constructor ,this It's the newly created object
4. Use call and apply Invocation time ,this It's the designated object
边栏推荐
- ThinkPHP is integrated with esaywechat. What's wrong with wechat payment callback without callback?
- 2020.3.3 notes async/await and promise and Then processes and threads
- Mongodb cluster
- 小白学习MySQL - 统计的'投机取巧'
- Laravel document sorting 8. Middleware
- Finereport (sail soft) handling the problem that the histogram data label is blocked
- Paper notes: multi label learning ESMC (I don't understand it, but I haven't written it yet, so I'll put it here for a place temporarily)
- 简单的恶意样本行文分析-入门篇
- Win10 environment phpstudy2016 startup failure record
- Laravel document sorting 10. Request life cycle
猜你喜欢

Failed to install redis interface

halcon之区域:多种区域(Region)生成(3)

关于TCP连接四次握手(或者叫四次挥手)的详细总结

Lecture record: data processing methods and applications of various spatial geodetic techniques

重磅直播 | 相移法+多频外差之数学原理推导+实现

Musk released humanoid robot. Why is AI significant to musk?

Coinlist queuing tutorial to improve the winning rate

CTF_ Web: Learn flask template injection (SSTI) from 0

Anaconda installation +tensorflow installation +keras installation +numpy installation (including image and version information compatibility issues)

GBASE 8s 索引R树
随机推荐
GBase 8s的封锁技术的基本介绍
OOP 向量加减(友元+拷贝构造)
2021.8.29 notes: register, bit operation, pointer, structure
[esp32 learning path 6 - Flash encryption]
Anaconda安装+TensorFlow安装+Keras安装+numpy安装(包含镜像和版本信息兼容问题)
彻底理解数据库事务
Immutable学习之路----告别传统拷贝
PHP extracts and analyzes table contents, and collects bidding information
Part I Verilog quick start
GbASE 8s中的Blob 页(Blobspace page)
Record of the 25th week
Laravel document sorting 2. Route related
Codeforces Round #802 (Div. 2) C D
GBASE 8s存储过程流程控制
Data import and export for gbase 8s
What is persistence? What are RDB and AOF in redis persistence?
Easyrecovery15 very easy to use computer data recovery software
Gbase 8s overall architecture
jsz中的join()
Package for gbase 8s