0531day05

Today's study is summarized below:

1. determination: if a determination is most

    1.1 if (condition) {

When the statement is executed after the conditions are met

}

   1.2if (condition) {

    }else{

   When the above conditions are not met, it is to the next

}

   1.3 Multiple conditional

       if (condition) {
           } the else

       if (condition) {
          } the else 

       if (condition) {
         } the else {
       }

If a group is determined, if only one, ELSEIF can have zero or more, else only 0 or 1.

Analyzing the restriction condition 2.if

    1. NAN when compared with the

    2. 0 is converted into a digital type false.

    Non-0 converted to true, math, false is converted to 0 true convert 10 converted into false, non-zero transformed into true What does it mean?

    3. The empty string is converted into false, true non-idle into

    4. Reference is converted into true all types

    5. Do not write condition if the decimal subtraction judgment, if the judgment, 0, false, empty string, undefined, null converted to false. All other converted to true

    typeof () method of detection data type, on the type of the parameter to be detected, the return value: string number function object undefind boolean

3. Function: the package code, the code is a set of
function names: naming rules and variables as naming
parameters: shape parameter (formal parameters), the type parameter may be limited, the number may not be limited
function body: when the code is invoked when the function is executed by
return: return value, if not written, undefined is returned
function function name (parameter 1, parameter 2 ...) {
function body  
return function return value

4. The built-in function
isNaN () Returns a Boolean
 typeof ()
the parseInt ()
parseFloat ()
Alert ()
the eval ()

 

Guess you like

Origin www.cnblogs.com/hhhyyc/p/10956854.html