Tuesday, January 5, 2016

JavaScript Operators: Introduction


In this article, I'd like to cover briefly the JavaScript operators. JavaScript operators can be grouped into 3 categories: unary, binary, and ternary operator.

1 Unary Operator

The unary operator only requires 1 value in order to invoke it. The unary operator takes form of both symbols and word. Its members are as follows:
2. Binary Operator

The binary operator would need 2 values in order to evaluate its results: one value before the operator and one value after the operator. The members of the binary operator category can be grouped further by its capability:
3. Ternary Operator

The ternary operator works on 3 values and it only has one member, the question mark and colon operator:
 var answer = true ? "True" : "False";
The ternary operator is also known as the conditional operator.

I will discuss most of these operators in future posts.

No comments:

Post a Comment