"JavaScript" JS Knowledge Point Review

Source: Internet
Author: User
Tags repetition

1. The introduction of two ways : directly in the tag line JS, the body at the bottom of the introduction.

2.5 Types of variables : number,string,boolean,null,undefined and a special type: Object

3. Variable naming : You cannot start with a number, you can use only $ _ and letters, you cannot use keywords to keep words, you cannot have Chinese and special symbols. If you name
Repetition overrides, naming as far as possible semantically (naming the work done), using the Hump naming method.

4. Type conversion : Number ();p arseint ();p arsefloat (); Boolean (); String ();

5. Arithmetic operator : +-*/%

6. Logical operator :&& | | !

7. Ternary operator : A>b?alert (1): Alert (2)

8. Comparison operator : = =, ===,>,<,>=,<=,!=

9. Connector : +

10. Assignment : =,+=,-=,!=,*=,/=,%=

11. Process Control :

A judgment statement is also called a conditional statement:
if () {}else{}
Switch{case "value":}

Loop statement:
For () {}
do{}while{}
while{}

Special Flow control Statements:
break; "Jump out of the whole loop body; This loop is invalid, all executed invalid"
Continue; "Skip this loop, continue to the next loop, to the current position below invalid, above valid" =

12. Definition of function : code snippet to complete a function
The meaning of the function:
>1< Easy Maintenance,
>2< re-use,
>3< code snippet to complete a feature

13. Naming conventions for functions :
The code defined first is the function, followed by the method name, if the definition name is a named method (not automatically executed), no name is anonymous
Method (automatic execution on load), function name semantics, cannot use special characters, can use hump and underscore, function name repetition will overwrite, and the letter
The parameter of the number is optional, if there is a parameter does not matter the number, if no return will automatically return undefined
If you want to load the page, you can use Onload= ("function name ()");

Assign the function directly to a variable. You can call a function indirectly by calling a variable

A . Pass in a function, and then call the new method, call,apply

. Global variables/local variables after the method Var declares something, within the function again VAR resets the external global variable, if the internal var
Under a statement, not only does the value not be taken, but it is also reset.

17. End of function, inverse parameter method :
return true "to end the current method and return the parameter"

"JavaScript" JS Knowledge Point Review

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.