Analyzing
ternary expressions with
loop
determines: if a determination is most
1.If (condition) {
if statement is executed after the condition is satisfied
}
Almost continuousl (condition) {
} {the else
when the above conditions are not met when left under
}
3. Multiple conditional
if (condition) {
} the else if (condition) {
} the else if (condition) {
If a group is determined, if only one, ELSEIF can have zero or more
else only 0 or 1
4.
1. NAN when compared with the
2. 0 is converted into digital type false. Nonzero converted into true
math
false converted into 0
true convert to 1.
0 converted to false, non-zero transformed into true What does it mean?
3. Empty string into a false, true non-idle replaced
4. type of reference in its entirety converted to true
plus or minus 5. Do not write decimal condition if the determination (key key)
in the determination if
0, false, empty string, undefined , null is converted to false. all other converts to true
typeof () method of detection data type, to be detected on the type of the parameter
values returned: string number function object undefind boolean
5.
Ternary expressions with
three head operation
ternary operator
simply point to understand is that if a simplified version of
the syntax
expression a group of Formula 2:? Expression 3;
condition (boolean)
to true expression when walking 2
false when walking Expression 3
var = 100 A;
A == 100 console.log ( "hello"):? console.log ( "bad");
6.
Console output
console.log ();
alert box output
alert ()
page output
document.write (); // format write a piece of content in the document, the content is a string of
7.
break; exit the loop
continue; out of this cycle
8. Functions
Function: the package code, the code is a set of
function names: naming rules naming rules and variables as
parameters: the parameter (formal parameters), the type parameter may be limited, the number may not be limited
function body: When the function Code execution is invoked by the
return: return value, if not written, undefined is returned
function function name (parameter 1, parameter 2 ...) {
body of the function
return value of the function return
}
9.
How function call?
Console.log (Fun) Fun says that a function
() function to perform symbolic execution is the
built-in function
isNaN () returns a boolean
typeof ()
parseInt ()
parseFloat ()
Alert ()
eval ()