TAILIEUCHUNG - Học php, mysql và javascript - p 35

Các nhà khai thác JavaScript cung cấp rất nhiều nhà khai thác mạnh mẽ từ số học, chuỗi, và các nhà khai thác hợp lý để so sánh, chuyển nhượng, và nhiều hơn nữa (xem bảng 15-1). Bảng 15-1. JavaScript khai thác vận hành các loại số học Array Phân Bitwise So sánh Tăng / lượng giảm String logic toán học cơ bản mô tả các thao tác định giá trị Array Thao tác bit trong byte So sánh hai giá trị Thêm hoặc trừ một Boolean nối. | Example 15-3 shows one of each. The first assigns the result of the expression 366 -day_number to the variable days_to_new_year and the second outputs a friendly message only if the expression days_to_new_year 30 evaluates to true. Example 15-3. Two simple PHP statements script days_to_new_year 366 - day_number if days_to_new_year 30 It s nearly New Year script Operators JavaScript offers a lot of powerful operators that range from arithmetic string and logical operators to assignment comparison and more see Table 15-1 . Table 15-1. JavaScript operator types Operator Description Example Arithmetic Basic mathematics a b Array Array manipulation a b Assignment Assign values a b 23 Bitwise Manipulate bits within bytes 12 A 9 Comparison Compare two values a b Increment Decrement Add or subtract one a Logical Boolean a b String Concatenation a string Each operator takes a different number of operands Unary operators such as incrementing a or negation -a take a single operand. Binary operators which represent the bulk of JavaScript operators including addition subtraction multiplication and division. One ternary operator which takes the form x y. It s a terse single-line if statement that chooses between two expressions depending on a third one. Operator Precedence As with PHP JavaScript utilizes operator precedence in which some operators in an expression are considered more important than others and are therefore evaluated first. Table 15-2 lists JavaScript s operators and their precedences. Operators 321 Table 15-2. The precedence of JavaScript operators high to low Operator s Type s . Parentheses call and member -- Increment decrement - Unary bitwise and logical Arithmetic - Arithmetic and string Bitwise Comparison Comparison Logical Logical Ternary - A Assignment Sequential evaluation Associativity Most JavaScript operators are processed in order from left to right in an equation. But some operators require processing from right to left instead. The .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.