JavaScript type conversions, operators, statements

Source: Internet
Author: User

1. Type conversion:

  It is divided into automatic conversion and casting, which is generally used for casting.

Other types are converted to integers: parseint ();

Other types convert to decimals: parsefloat ();

Determine if it is a valid number type: IsNaN ();

is a number then returns false, not a number to return ture.

Example:

2. Operators:

  Math operator : +-*/% + +-;

  relational operators : = =! = >= <= > <;

  logical operator :&& | | ! ;

  Other operators : + = = *=/=%=? ;

3. Statement:

 It is generally divided into sequential, branching, and cyclic statements.

(1) Branch statement if:

if (judging condition)

{

Statements that meet the criteria to be executed

}

Else

{

Statements executed when a condition is not met

}

(2) Loop for statement:

For ( initial condition; cyclic condition; state change )

{

  Loop body

}

(3) Problem type: exhaustive, iterative.

(4) Two keywords: break and continue.

(5) If you want to output the value of a parameter: the value of the output is "+a+" and "+b"

JavaScript type conversions, operators, statements

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.