Call, apply, bind

Source: Internet
Author: User

1, the function execution context will be more This,argumentsAndfunction Parameters。

2.Call , apply, bindThe first parameter of these three functions is the object to which this is pointed, the difference being the second argument.

3, use mode 1.PagerNote: parameters are directly put in, the second third nth parameter all usecommaSeparated and placed directly in the back form:func. Pager (Thisarg, arg1, arg2,..., argn)

2.ApplyNote: All parameters must be placed in aArrayIn the form of the inside pass:func. Apply (Thisarg, [Arg1, arg2,..., argn])

3.BindDescription: In addition to returning isfunction, its parameters are in the same form as call:func. Bind (Thisarg, arg1, arg2,..., argn ) () 

4. Summary:the parameters of the three are allowed for various types, including functions, objects, strings, etc.

Call, apply, bind

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.