Page 91 - DCAP202_Fundamentals of Web Programming
P. 91

Fundamentals of Web Programming




                    Notes
                                     Did u know?  Its value is a string indicating the data type of the operand.
                                   The typeof operator evaluates to “number”, “string”, or “boolean” if its operand is a number,
                                   string, or boolean value and returns true or false based on the evaluation.
                                   Here is the list of return values for the typeof Operator :

                                                   Table 7.5:  List of  Return Values  for the  typeof  Operator

                                      Type                               String Returned by typeof
                                      Number                "number"
                                      String                "string"
                                      Boolean               "boolean"
                                      Object                "object"
                                      Function              "function"
                                      Undefined             "undefined"
                                      Null                  "object"




                                      Task  Give examples of different types of operators.

                                   7.1.8 Operator’s Precedence

                                   The precedence of operators determines the order they are applied when evaluating an expression.
                                   You can override operator precedence by using parentheses. The precedence of operators, from
                                   lowest to highest is as follows:
                                   comma  ,
                                   assignment  =  +=  -=  *=  /=  %=  <<=  >>=  >>>=  &=  ^=  |=
                                   conditional  ?:
                                   logical-or  ||
                                   logical-and  &&
                                   bitwise-or  |
                                   bitwise-xor  ^
                                   bitwise-and  &
                                   equality  ==  !=
                                   relational  <  <=  >  >=
                                   bitwise  shift  <<  >>  >>>
                                   addition/subtraction  +  -
                                   multiply/divide  *  /  %
                                   negation/increment  !  ~  -  ++  —
                                   call,  member  ()  []  .
                                   Self Assessment


                                   Fill in the blanks:
                                   1.  ........................... operators test to see if two variables relate to each other in the specified
                                       way.


          84                                LOVELY PROFESSIONAL UNIVERSITY
   86   87   88   89   90   91   92   93   94   95   96