Page 92 - DCAP202_Fundamentals of Web Programming
P. 92

Unit 7: Operators in JavaScript




          2.   ........................... is called Bitwise NOT Operator which is a is a unary operator and operates  Notes
               by reversing all bits in the operand.
          3.   The operator ........................... is the multiply AND assignment operator, it multiplies right
               operand with the left operand and assign the result to left operand.
          4.   The decrement operator ........................... the variable.
          5.   ........................... operator  first evaluates an expression for a true or false value and then
               execute one of the two given statements depending upon the result of the evaluation.
          6.   The ........................... is a unary operator that is placed before its single operand, which can
               be of any type.
          7.   The ........................... of operators determines the order they are applied when evaluating
               an expression.

          8.   The operator ........................... checks if the value of two operands are equal or not, if values
               are not equal then condition becomes true.
          9.   Due to the possibly confusing nature of pre-and post-increment behaviour, code can be
               easier to read if the ........................... operators are avoided.
          10.  An operator | is called ........................... Operator. It performs a Boolean OR operation on
               each bit of its integer arguments.

          7.2 Expressions

          An expression is any valid set of literals, variables, operators, and expressions that evaluates to
          a single value. The value may be a number, a string, or a logical value. Conceptually, there are
          two types of expressions: those that assign a value to a variable, and those that simply have a
          value.




                 Example: The expression

          x = 7
          It is an expression that assigns x the value 7. This expression itself evaluates to 7. Such expressions
          use assignment operators. On the other hand, the expression

          3 + 4
          Simply evaluates to 7; it does not perform an assignment.



             Did u know?  The operators used in such expressions are referred to simply as operators.
          JavaScript has the following kinds of expressions:

              Arithmetic: evaluates to a number, for example
              String: evaluates to a character string, for example “Fred” or “234”
              Logical: evaluates to true or false
          The special keyword null denotes a null value. In contrast, variables that have not been assigned
          a value are undefined, and cannot be used without a run-time error.





                                           LOVELY PROFESSIONAL UNIVERSITY                                   85
   87   88   89   90   91   92   93   94   95   96   97