JavaScript Basic Knowledge Collation

Source: Internet
Author: User
Tags float double true true

JS Comment Syntax:

Single-line Comment://The later content will be commented

Multiline Comment:/* Intermediate content is commented */

Output syntax: alert (); Output content confirm (); Output selectable content prompt (); Output and accept user input

Embed JS code: Theoretically, any location on the page can be embedded but generally we want to embed the JS code in the lowest part of the page

Inline <script type= "Text/javascript" ></script>

External <script type= "file Address" ></script>

Basic knowledge of the program:

1) All characters Embox is English half angle

2) In most cases, add a semicolon after each statement ends

3) Add a newline after each code ends

4) Pre-and post-process echoes

Strongly typed syntax: A data type must be defined on transfer

Weakly typed syntax: No data types are defined and can be converted automatically

Basic data type: integer: int single precision decimal: float double decimal: Double decimal: Decimal Currency: Money

Character: Char string: String Boolean: BOOL (True True False) DateTime type Datetame

Variable:

All variable definitions are defined with VAR

Type conversions:

Other types are converted to integers: parseint ();

Other types convert to decimals: parsefloat ();

Operator:

Math operators: +-*/% + Good to do string stitching

Relational operators: = =! = > >= < <=

Logical operator:&& | | !

Other operators: + = = *=/=%=?: (condition?) satisfies the condition "OK": The condition "no" is not satisfied)

JavaScript Basic Knowledge Collation

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.