Conditional Operator in JavaScript | Ternary, Example

Conditional operator in JavaScript provides a one line approach for creating a simple conditional statement. It is often used as a shorthand method for if-else statement. It makes the code much more simple, shorter and readable. The conditional operator (?:) is also known as ternary operator because it takes three … Read more

Logical Operators in JavaScript | Boolean, Example

Logical operators in JavaScript are those operators which are used to form compound conditions by combining two or more simple conditions or relations. In other simple words, logical operators combine the comparison into one condition group. It is useful when we to check more than one condition at a time … Read more

Comparison Operators in JavaScript, Relational, Example

Comparison (Relational) operators in JavaScript are those operators that are used for comparing between two numeric values, strings, objects, or two quantities. The comparison operators determine the relationship between them by comparing operands (or values). For example, to know which is a greater number, comparing the age of two persons, … Read more

Assignment Operator in JavaScript | Example Program

An operator that is used to assign/update the value of a variable is called assignment operator in JavaScript. The most common assignment operator is equal operator “=”, which assigns the right-hand value to the left-hand variable. The general syntax is as follows: variable = value; // Here, a value can … Read more