The basic knowledge data type of the JavaScript program. {0912}

Source: Internet
Author: User
Tags true true

JS scripting language:


This is the name of Jaxascript.


JS is the scripting language used within the Web page

JS is a very powerful language.

The basic syntax of JS

Comment Syntax: single-line comment//Multiline comment/**/

Output syntax: Double-label Formula:<script> formula content </script>
Alert ("message") formula content} This code is a popup message on the page

Confirm ("Information"); Formula content} This code pops up a dialog box that interacts with the user. There is {OK} {cancel}
Prompt ("information") formula content} This code pops up a dialog box that lets the user enter

Embed JS code:
General JS Code is at the bottom, so try to write down.
Formula format <script type= "Text/javascript" ></script>

Basic knowledge of the program:

JS all the characters are all English half-width

In the case of a large department, a semicolon is added after each statement ends;

After each piece of code, add a newline {carriage return} so that the code you enter looks neat and tidy.

The program echoes back and forth. Preceded by a parenthesis "(" There must be a parenthesis end after ")"

Data type: Data stored in a program, stored in a name called a variable
Strongly typed languages: data storage needs to exist in the corresponding data type variables
Weakly typed languages: non-differentiated types when data is stored (type auto-conversion)

Strong language code type:
Shaping (integer) int

Single-precision fractional float

Decimal doble with double precision

Fractional decimal

Uncommon type, currency type money

Character Char

Strings string

boolean bool True True false-false

Date Time Type datetime

Variable definition:

var a = 10;

If you define a decimal or integer variable, the value after the equal sign is written directly

If you define a string variable, the value after the equals sign needs double or single quotation marks

Type conversion: parseint

The

JavaScript program basic knowledge data type. {0912}

Related Article

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.