当前位置:网站首页>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
边栏推荐
- 三角形类(构造与析构)
- Anaconda installation +tensorflow installation +keras installation +numpy installation (including image and version information compatibility issues)
- PHP encapsulates curl to send get and post request methods, and uses
- CTF_ Web: Advanced questions of attack and defense world expert zone WP (9-14)
- Immutable学习之路----告别传统拷贝
- Gbase 8s stored procedure execution and deletion
- 515. find the maximum value / Sword finger offer II 095 in each tree row Longest common subsequence
- CTF_ Web: Learn flask template injection (SSTI) from 0
- Mongodb cluster
- Synchronous and asynchronous functions (callback function, promise, generator, async/await)
猜你喜欢

js中的concat()

Finereport displays and hides column data according to conditions

A detailed summary of TCP connection triple handshake

unity Quad剔除背面并剔除透明部分的shader

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

Value transfer between parent and child components of wechat applet

什么是存储引擎以及MySQL常见的三种数据库存储引擎

CTF_ Web: advanced problem WP (5-8) of attack and defense world expert zone

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

jsz中的join()
随机推荐
Thorough understanding of database transactions
Blob page in gbase 8s
CMD operation MySQL in Windows
Record small knowledge points
什么是持久化?redis 持久化中的RDB和AOF是什么?
重磅直播 | 相移法+多频外差之数学原理推导+实现
如何筛选出和产品相关的词,精准排除掉无效词
LabVIEW开发气体调节器
OOP 向量加减(友元+拷贝构造)
kenlm
CTF_ Web: advanced problem WP (5-8) of attack and defense world expert zone
Gbase 8s index R tree
Should I use on or where for the left join
English Grammar - pronunciation rules
Trigger for gbase 8s
A detailed summary of TCP connection triple handshake
Introduction to the isolation level of gbase 8s
OBS Browser+浏览器的基本使用
GBASE 8s的多线程结构
Codeforces Round #802 (Div. 2) C D