Tuesday 17 December 2013

Javascript : Expressions & operators

Expressions :
An expression is valid unit of code that output a value.

Basically, there are two types of expressions:
->those that assign a value to a variable
    Ex : The expression x = 1 is an example of the first type.
           This expression uses the = operator to assign the value
           seven to the variable x. The expression itself evaluates to one.
->those that simply have a value.
    Ex : The code 1 + 4 is an example of the second expression type.
          This expression uses the + operator to add one and four together
          without assigning the result, five, to a variable.


Operators :
An Operator is something which help to perform some operation
                 operand1   operator  operand2

Types :
           Arithmetic Operators :
                                 

           Comparison operators :

                                         

           Logical Operators:
                                       
           Bitwise operators :
                                         

           Assignment Operators:
                                         
           Conditional Operator :
? :Conditional ExpressionIf Condition is true ? Then value X : Otherwise value Y

No comments:

Post a Comment