Operators

Operators && Logics Operators

Logical Operators

10 < 10;    // FALSE
10 > 10;    // FALSE
10 == 10;   // TRUE
10 != 10;   // FALSE
10 <= 10;   // TRUE
10 >= 10;   // TRUE
10 && 10;   // TRUE
10 || 10;   // TRUE
!10;        // FALSE
!!10;       // TRUE

Arithemetics Operators

1 + 1;      // SUM
1 - 1;      // SUBTRACT
1 / 1;      // DIVIDER
1 * 1;      // MULTIPLE
4 % 2;      // MOD
10 ** 0;    // POW
10 & 2;     // AND Bitwise operator
10 | 2;     // OR Bitwise operator 
10 ^ 2;     // XOR Bitwise operator 
10 << 2;    // Shift left (multiply each step)
10 >> 2;    // Shift right (divide each step)
++1;        // First increment and then return incremented value  
--1;        // First decrement and then return decremented value  
1++;        // First return value and then increment value
1--;        // First return value and then decrement value  

Value is truthy when is not nil or false. Example: empty array is true, empty hash is true, integer 0 is true.