2. Tutorial 2: javascript operators, expressions, and statements

Source: Internet
Author: User

This part is slightly different from java, so be careful when learning


1. operators:

1) arithmetic, relational, logic, value assignment, bit operations] refer to c ++ and java to learn why it starts with "java !).

2) dot operations, new operations, patent operations on objects, no need to worry!

3) typeof (variable)], type judgment operator.

4) operator precedence]. This is boring for development. Please check it yourself!


2. expression:

Operator + common variables, and "Combination" of results, the result type is not separated from the "first lesson" content. It is the basic unit of a "statement.


3. Statement:

The feature ending with ";" only requires line breaks)

The statement can be summarized as follows ):

1) Value assignment, declaration, and definition of variables

2) call a function or Method

3) return of a function or Method

4) define the loop or branch structure

5) structure definition of functions or methods


4. Branch Structure:

1) if... else

2) switch (Number)... case (value 1)... case (value 2)... default...

5. Loop Structure:

1) for (var I = 0; I <100; I ++) {...} // counting cycle

2) while (expression ){...}

Do {} while (expression );

3) for (var m in array) {...} // corresponds to java's for... each



This article from the "Yu yu" blog, please be sure to keep this source http://johnyu.blog.51cto.com/7838287/1299618

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.