tailieunhanh - JavaScript Bible, Gold Edition part 123
JavaScript Bible, Gold Edition part 123. This book will bring programmers and non-technical professionals, including casual programmers and scripters, painlessly up to speed on all aspects of mastering JavaScript. Key topics include programming fundamentals, JavaScript language elements and how to use them effectively, and how to easily and efficiently add powerful new functionality to HTML documents and Java applets. | 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. Note The vast majority of JavaScript operators have been in the language since the very beginning. But as you may expect from an evolving language some new entries have been added to the lexicon. In the rest of this chapter compatibility charts typically govern an entire category of operator. If there are version anomalies for a particular operator within a category they are covered in the text. In This Chapter Understanding operator categories Exploring the role of operators in script statements Recognizing operator precedence Operator Categories To help you grasp the range of JavaScript operators I group them into seven categories. I assign a wholly untraditional name to the second group but a name that I believe better identifies its purpose in the language. Table 40-1 shows the operator types. Table 40-1 JavaScript Operator Categories Type What It Does Comparison Compares the values of two operands deriving a result of either true or false used extensively in condition statements for i and for loop constructions Continued 1070 Part IV JavaScript Core Language Reference Table 40-1 continued What It Does 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 .
đang nạp các trang xem trước