Tham khảo sách 'javascript bible_ chapter 32', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | JavaScript Operators JavaScript is rich in operators words and symbols in expressions that perform operations on one or two values to arrive at another value. Any value on which an operator performs some action is called an operand. An expression may contain one operand and one operator called a unary operator or two operands separated by one operator called a binary operator . Many of the same symbols are used in a variety of operators. The combination and order of those symbols are what distinguish their powers. Operator Categories To help you grasp the range of JavaScript operators I ve grouped them into five categories. I have assigned a wholly untraditional name to the second group but a name that I believe better identifies its purpose in the language. Table 32-1 shows the operator types. In This Chapter Understanding operator categories Role of operators in script statements Table 32-1 JavaScript Operator Categories Type What It Does Comparison Compares the values of two ooerands. derivina a result of either true or false used extensively in condition statements for and for loop constructions Connubial Joins together two operands to produce a single value that is a result of an arithmetical or other operation on the two Assignment Stuffs the value of the expression of the right-hand operand into a variable name on the left-hand side. sometimes with minor modification. as determined by the operator symbol Boolean Performs Boolean arithmetic on one or two Boolean operands Bitwise Performs arithmetic or column-shifting actions on the binary base-2 representations of two operands 666 Part III JavaScript Object and Language Reference Any expression that contains an operator evaluates to a value of some kind. Sometimes the operator changes the value of one of the operands other times the result is a new value. Even this simple expression 5 5 shows two integer operands joined by the addition operator. This expression evaluates to 10. The operator is what .