JavaScript Functions (1)

Source: Internet
Author: User

Word Translation list:

Function: function (function not translated)
Declare: Definition
Assign: Assign, assign
Functionbody: function body (the content of the function)
Object: Object
Property: Property
Unnamed: anonymous (not translated as unnamed here)
Object Oriented Programming: surface relative phase programming
Class: class (for example, I translate the class data type to the class data type)
Pointer: pointer
Reassign: Reallocation
Nest: nesting
Feature: Features
Local/Global: Local/Global
Blueprint: Blueprint (?)
User Defined: User-Defined
Instance: instance
Prototype: Prototype (no translation except the title)
Internal: Internal
Constructor: Constructor
Duplication:

Function: defined

You can use the following methods to define a function. All of these are valid, but there are some differences in how they are implemented in the background.

Common Writing Method

Generally, we use this syntax to define a function:

Code:
Functionname ([parameters]) {functionbody };

Example D1:

Code:
Function add (A, B)
{
Return A + B;
}
Alert (add (1, 2); // result 3

When we define a function like this, the function content will be compiled (but will not be executed immediately unless we call it ). You may not know that an object with the same name is also created when this function is created. In our example, we now have an object called "add" (for more information, see function: Object section .)

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.