Difference between revisions of "Operators"

From SDU
Jump to: navigation, search
(Arithmetic Operators)
Line 13: Line 13:
 
</source>
 
</source>
  
== Comparison Operators ==
+
== Comparison (Relational) Operators ==
 
<source lang="javascript">
 
<source lang="javascript">
==
+
== Equal to
!=
+
!= Not Equal to
 +
<= Less than or equal to
 +
<  Less than
 +
>= Greater than
 +
>  Greater than
 
</source>
 
</source>
  
Line 29: Line 33:
 
&&
 
&&
 
!
 
!
 +
</source>
 +
 +
== Assignment Operators ==
 +
<source lang="javascript">
 +
=  simple assignment
 +
+= Compound addition, like in C
 +
-=  Compound subtraction
 +
*= Compound multiplication
 +
/= Compound division
 +
%= Compound modulo
 
</source>
 
</source>

Revision as of 16:27, 3 March 2009

To make corrections or additions to this article, select the edit tab above.
To discuss or ask questions about this article, select the discussion tab above.

Arithmetic Operators

<source lang="javascript"> + Addition - Subtraction

  • Multiplication

/ Division % Modulo, for example a % b will result in the remainder of a divided by b </source>

Comparison (Relational) Operators

<source lang="javascript"> == Equal to != Not Equal to <= Less than or equal to < Less than >= Greater than > Greater than </source>

Concatenation Operators

<source lang="javascript"> + </source>

Logical Operators

<source lang="javascript"> || && ! </source>

Assignment Operators

<source lang="javascript"> = simple assignment += Compound addition, like in C -= Compound subtraction

  • = Compound multiplication

/= Compound division %= Compound modulo </source>