当前位置:网站首页>The difference between apply, call and bind
The difference between apply, call and bind
2022-07-25 03:57:00 【Big chicken legs are best】
Their role is to this Bind to the specified object .( change this The direction of )
- apply Take two parameters , The first parameter specifies the body of the function this The direction of the object , The second parameter is a subscript set , This set can be an array , It can also be an array of classes ,apply Method passes the elements in this collection as parameters to the called function .
- call The number of parameters passed in is not fixed , Follow apply The same thing , The first parameter also represents the inside of the function this Point to , When the first parameter is null、undefined when , The default point to window; Starting with the second parameter , Each parameter is passed into the function in turn .
- bind Function allows you to pass in the required this Bound object , And optionally pass in all or part of the formal parameters , Then return a new function ( Original function changed this Function pointed to )
边栏推荐
- Database transactions (often asked)
- Network security - comprehensive penetration test -cve-2018-10933-libssh maintain access
- Chapter 18 request matcher serverwebexchangematcher of oauth2loginauthenticationwebfilter
- Swagger key configuration items
- Chrome debugging skills
- How should enterprise users choose aiops or APM?
- 场景之在线人数或者粉丝查询实现
- Top101 [linked list] must be applied for interview
- 226. Flip binary tree DFS method
- You are only one SQL statement away from the tdengine Developer Conference!
猜你喜欢

NC | progress has been made in the study of the ecological network relationship between dissolved organic carbon and microorganisms in the context of global change

Localization distillation for dense object detection cvpr2022

Fiddler grabs packets and displays err_ TUNNEL_ CONNECTION_ FAILED

基于ABP实现DDD--领域逻辑和应用逻辑

300. Longest increasing subsequence

Multithreading advanced Step2

Fifth day of force deduction

292. Nim game
![[leetcode medium] 34. Find the first and last positions of elements in the sorted array - array double pointer](/img/f0/e572fe077ddd51b9c160e3382b2a07.png)
[leetcode medium] 34. Find the first and last positions of elements in the sorted array - array double pointer

Swagger key configuration items
随机推荐
Unity: test rotation function
Use of CCleaner
Operations in shell
Interview question 05.06. integer conversion
[Flink] aggregation operator
Time complexity and space complexity
[Flink] protocol operator reduce
292. Nim game
Original | ueditor1.4.3-asmx bypasses WAF
ECCV 2022 | rethinking image blending for data enhancement in vision transformers
MySQL eight shares
Postgraduate entrance examination experience
Advanced numbers | [calculus of multivariate function] chain derivation method, implicit function derivation method, total differential form invariance, multivariate function extremum
Implementation of online number or fan query of the scene
Acwing 870. approximate number
What is technical support| Daily anecdotes
Deep learning Titanic (beginner) kaggle Liu er's homework Lesson 8
301. Delete invalid brackets
应急响应全栈
[leetcode medium] 34. Find the first and last positions of elements in the sorted array - array double pointer