The front end of the fifth day of learning javaScript

Currently engaged in front-end work, particularly summary javaScript for them to learn the basics, I summarize the use of special dedicated web front end currently studying little friends, I hope you break their own piece of the sky to the front end of the field

One. Comparison operators:
== equal (only determines whether the value of the same on both sides) === congruent (determination value also determines the type of data)
comparison operator must be a Boolean result.

Logical Operators:
&& Logical AND (true only are true, then a false false)
|| logical OR (is a true true false are false only)
logic NOT!

Shorting Syntax:
implicit conversion to true: number other than 0 (Infinity), non-empty string
implicit conversion false: 0, "", NaN , undefined, null

Short circuit in series with the logical syntax :() if a is true, the result is B; if A is a fake, the result is a;
logical syntax :( or short circuit in parallel) if a is true, the result is a; if a is false, the result is b;

Backup options:

// to user input
// backup options
var age = parseInt (prompt ( "Enter the age")) || 1;
Alert ( "Your age is" + age + "years old");

if (conditional expression) {
satisfies the conditional expression, the statement is executed;
} {the else
condition is not satisfied expression, the statement is executed
}

The same thing: regardless of which structure if statement is executed, the statement following the if statement executes other js.
Jumping phenomenon: if the statement will be executed once the structure, ends immediately if the statement is not repeated.

Guess you like

Origin blog.51cto.com/14334627/2410144