Increment and Decrement Operators in JavaScript

The JavaScript Increment and Decrement Operators useful to increase or decrease the value by 1. For instance, Incremental operator ++ used to increase the existing variable value by 1 (x = x + 1). The decrement operator – – is used to decrease or subtract the existing value by 1 (x = x – 1). … Read more

JavaScript Ternary Operator

The JavaScript Ternary Operator is also called a Conditional Operator. The Ternary Operator returns the statement depending upon the expression result and is used in the decision-making process. The syntax of a JavaScript ternary conditional operator is Test_expression ? statement1: statement2 If the given test expression is true, it returns statement1. If the test expression … Read more

JavaScript Assignment Operators

The JavaScript Assignment operators are used to assign values to the declared variables. Equals (=) operator is the most commonly used assignment operator. For example: var i = 10; The below table displays all the JavaScript assignment operators. JavaScript Assignment Operators Example Explanation = x = 15 Value 15 is assigned to x += x … Read more

JavaScript Logical Operators

The Comparison Operators are used to compare two variables. What if we want to compare more than one condition? Very simple, JavaScript Logical Operators will do the trick for you. These JavaScript operators are used to combine two or more conditions and perform the logical operations using && (AND), || (OR), and ! (NOT). The … Read more

JavaScript Comparison Operators

JavaScript Comparison operators are mostly used either in If Statements or Loops. For example, JavaScript Comparison operators are commonly used to check two variables’ relationships. If the relation is true, it will return Boolean TRUE; if the relation is false, it will return Boolean FALSE. The below table shows all the JavaScript Relational Operators with … Read more

JavaScript Arithmetic Operators

The JavaScript Arithmetic Operators include operators like Addition, Subtraction, Multiplication, Division, and Modulus. All these operators are binary operators, which means they operate on two operands. The below table shows the Arithmetic Operators with examples. JavaScript Arithmetic Operators Operation Example + Addition 10 + 2 = 12 – Subtraction 10 – 2 = 8 * … Read more