Details about js anonymous functions as function parameters and js anonymous function parameters

Source: Internet
Author: User

Details about js anonymous functions as function parameters and js anonymous function parameters

I sincerely lament that js is really annoying.

After learning it, I gradually understood what it is: the language is universal, not good, but good at and not good.

Inheritance, polymorphism, and even pointer, can be implemented by c, c ++, java, and javascript (the difference between Lei Feng and Lei Feng tower in java, and the name does not know how many people are involved) it can also be flexibly implemented.

I have forgotten it again today. Anonymous functions are used as function parameters.

The code is very short and dirty.

<! DOCTYPE html>  

Why can an anonymous function be automatically executed as a function parameter?

Is the anonymous function Self-executed?

Error !!! Anonymous function! = Self-executed anonymous Functions

There is only one truth:An anonymous function is called and executed in the call (using an anonymous function as a parameter) function.

Function test (a, B) {a + = 1; // B is an object, and the function name is also an object, so B can refer to a function. // similar to the function name in c ++. // a is copied to B (result). // js is flexible. B ();}

The above js anonymous functions, as detailed descriptions of function parameters, are all the content that I have shared with you. I hope to give you a reference and support for the help house.

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.