JAVA SCRIPT OPERATORS

JAVA SCRIPT OPERATORS





 

                 An operator is used to transform one or more  values into single resultant value.The value to which the operator is applied is referred to as operand.

               There are so many operators are there in java script.

  1. Arithmetic operators
  2. Comparison operator
  3. Logical operator
  4. String operators
  5. Assignment operators
  6. Ternary operators
  7. Special operators

Arithmetic operators:

  • + : Add
  • *  : Multiply
  • % : Modules
  • - : Sub
  • -- :  Return the value than decrement
  • & : Division
  • ++ : Return the value than increment

 Comparison operator:

  • == : equal
  • === : strictly equal
  • != : not equal
  • !== : strictly equal
  • < : less than
  • <= : less than or equal to
  • > : greater than
  • > = : greater than or equal to

Logical operator:

  • && : AND
  • || : OR
  • ! : NOT

String operators:

  • +
EX:"ab"+"cd"="abcd"


Assignment operators:

  • =
  • +=
  • -=
  • *=
  • /=
  • %=

Ternary operators:

               java script supports the conditional expression operator,the format for a conditional expression is condition?value1:value2.

ex:(x>y)?5:7


Special operators:

  • New operator
  • Delete operator
  • The void operator
  • comma operator

Post a Comment

0 Comments