JS Pristine (function)

Source: Internet
Author: User

A function is an object that is unique to another object and that it can be called. Functions can be implemented: code reuse, information hiding, code combination calls.

When a function is established, it establishes: the context, the code that invokes the function. Each function (except Function.prototype) will have a prototype object.

   function foo () {     //code}

Foo.prototype = {Constructor:this};

It must have a Foo.prototype object, and this is explicitly included.

The function literal is the literal, and it belongs to the category of the expression. The function literal can then be used where the expression can be used.

The parameters of the JS function are passed by value. It does not check the type and number of arguments passed in, or if the parameter value is undefined when the argument is less than the formal parameter argument function. Each function is this,this when the function is executed, and is related to how the function is called (something similar to the dynamic scope). The invocation methods are divided into: Method invocation, Function call, constructor call, apply call.

JS Pristine (function)

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.