js a triplet of expressions

First, the judgment
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 An empty string into false, true non-idle replace
all converted into a true reference type 4.
5. the if it is determined in the determination if
not write decimal subtraction (key key) 0, false 6. condition, empty string, undefined, null converted all converted into other false to true.
7.typeof () method of detection data type, on the type of the parameter to be detected
8. return value: string number function object undefind bo
two, cycle
1 . console output: the console.log ();
alert box output: alert ()
page output: document.write ();
2. cycle: repeated to execute a section of code within the conditions
for, for in, foreach, forof , the while, DoWhile
for (condition 1; condition 2; 3 condition)
{
loop statements
}
three functions
functions: the package code, the code is a set of
function names: naming same rules as variables
Parameters: parameter (formal parameters), the type parameter may be limited, the number may not be limited
function body: when the function is invoked when the code executed 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
}

Guess you like

Origin www.cnblogs.com/ggss/p/10955931.html