« Home « Kết quả tìm kiếm

Building Expressions


Tóm tắt Xem thử

- As we mentioned earlier in this lesson, an expression is a phrase—or a collection of variables, numbers, text, and operators—that evaluates to a value.
- To the right of the equals sign, you see 6 * 2—this is an expression.
- When this script is executed, the expression 6 * 2 is replaced by the result of 6 multiplied by 2, or 12.
- An expression can contain variables, arrays, even function calls—anything that, when evaluated, returns a value.
- var total:Number = subTotal + tax;.
- The value of total is based on the result of adding the variable subTotal to the variable tax.
- The expression is subTotal + tax..
- The value of discount is based on the result of multiplying the variable totalPrice by the value of the third element in the employeeDiscount array.
- employeeDiscount[2] is the expression..
- the value of japaneseYen is based on the value returned by a call to the convertToYen() function—making the function call itself the expression..
- Expressions enable you to avoid hard-coding values that will remain the same no matter what.
- Many of the scripts in this book rely on expressions—that's because without them, your project plays back in exactly the same way each time it's viewed.

Xem thử không khả dụng, vui lòng xem tại trang nguồn
hoặc xem Tóm tắt