[javascript| Basic concept] study notes

Source: Internet
Author: User

1/syntax

A. Case-sensitive

B. identifier (the first character must be the letter/"_"/"$", the other can be the letter/"_"/"$"/number, cannot use keywords, reserved words), generally using the hump or underline split format

C. Comments://single-line comments,/* Multiline comments */

D. Strict mode: Enable mode: Top Add a line to compile the instruction code "use strict"; You can also add inside a function to specify that the function executes in strict mode

E. Statement: a semicolon; end, multiple statements combine blocks of code, with {} wrapped

2/keywords and reserved words

A set of characters for a specific purpose (keyword): break does instanceof typeof case Else new Var catch finally return void continue for switch W Hile Debugger Function This width default if throw delete in try

Possible as a keyword (reserved word): abstract enum int short Boolean export interface static byte extends long super char final Nati ve synchronized class float package throws const GOTO private transient implements protected volatile double I Nport public let yield eval arguments

3/variable

Loosely, used to hold any type of data

Define with the Var operator, and then initialize

A. Declare simultaneous initialization of E.g.:var msg = "This is a variable declaration";

B. First declare, then initialize E.g.:var msg; msg = "This is a variable declaration";

C. Declare multiple variables, separated by multiple semicolons e.g.:var MSG1 = "Msg1", MSG2 = "MSG2";

4/Data type

Simple data type (base data type): underfinded/null/boolean/number/string

Complex Data class type: Object

Methods for detecting basic data Types typeof, E.g.:typeof ("string");  You can also typeof "string"; This is an operator, not a function

underfined return "underfined"

Null/object returns "Object"

Boolean returns "Boolean"

Number returns "Number"

String returns "string"

Functions return "function"

[javascript| Basic concept] study notes

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.