Operators: ========== Arithmetic Operators: ===================== + ==> Addition ==> Binary - ==> Subtraction ==> Binary * ==> Multiplication ==> Binary / ==> Normal Division ==> Binary % ==> Modulo Division ==> Binary Note: ===== No integer data No float data we have only one representation: number // Arithmetic Operations on only Integers var a = 12 var b = 24 let c = 12.23; console.log("Addition = "+(a+b)); console.log("Subtraction = "+(a-b)); console.log("Multiplication = "+(a*b)); /* normal Division ==> / ==> can return a quotient value modulo division ==> % ==> can return the remainder */ console.log("Normal Division = "+(a/b)); console.log("Modulo Division = "+(a%b)); console.log("Addition = "+(a+c)); console.log("Subtraction = "+(a-c)); console.log("Multiplication = "+(a*c)); console.log("Normal Division = "+(a/c)); console.log("Modulo Division = "+(a%c)); ================================================ Assignment Operator: ==================== ==> = ==> for assigning the value to the identifier/expression etc. ex: a = 10; a = 12; // c,b = 12,24; // let b,c = 12,24; let b,c; b = 13; c = 24; // var p,q = (100,200); p = 123;q = 131; console.log(a); console.log(b); console.log(c); console.log(p); console.log(q); ================================================ Equality Operators: ==================== == ==> Equal Operator ==> binary != ==> Not Equal Operator ==> Binary comparison return: Boolean values (true, false) ex: 10 == 10 ==> true 10 != 10 ==> false var a = 10; let b = 10; console.log(a == b); console.log(a != b); console.log(p = 1); // q == 12 console.log(a = b); ============================================================= Compound Operators: =================== ==> the operator combine with assignment operator is called as "compound operator". +=, -=, *=, /=, %= &&=, ||=, != &=, |=, ^= etc. x = x + 10 ==> x += 10 x = x - 1 ==> x-=1 x = 100; // by default this definition can understood as the 'x' is var type console.log("x = "+x); // x = x + 100; x += 100; console.log("x = "+x); ==================================================== String Concatenation Operator: ============================== ==> + ==> Concatenation ==> Joining of two or more strings into one string ==> String ==> Group of characters can enclose with single quotes or double quotes. ex: 'a' ==> string 'abc' ==> string "a" ==> string ==> 'a' + 'b' ==> 'ab' ==> we can concate the number to the string or concat the string to the number. ex: 73 + "Java" "Java" + 73.123 var a = "JavaScript "; var b = 'is Scripting Language'; let p = 'Java'; const q = 73; let c = a + b; const r = p + q; console.log(c); console.log(r); ========================================== Unary Plus and Unary Minus =========================== Unary Plus ==> representing positive numbers Unary Minus ==> representing negative numbers a = 123; console.log("The Value in Positive Nature = "+(+a)); console.log("The Value with negative sign = "+(-a)); ===================================================== Increment Operators: ==================== ++ can increase the value by '1'. ==> can define in two ways: Pre-Increment Operator Post-Increment Operator ==> Unary Operators. Pre-Increment Operator ====================== Syntax: ++operand 1) can increase the value by '1' 2) assignment var a = 101; console.log("a = "+a); ++a; console.log("a = "+a); b = ++a; console.log("a = "+a); // 103 console.log("ab = "+b); // 103 Post-Incrementation: =================== Syntax: operand++; 1) Assignment 2) Increase the value by '1' b = ++a b = a++ var a = 101 console.log("a = "+a); a++; console.log("a = "+a); b = a++; console.log("a = "+a); // 103 console.log("b = "+b); // 102 console.log("a = "+(a++)); console.log("a = "+a);