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 .)