1 頁 (共 1 頁)

邏輯運算符號

發表於 : 2006-07-31 17:15:34
yehlu
http://www.quirksmode.org/js/boolean.html

For JavaScript purposes, you need to know AND, OR and NOT:

* AND (&&): True when both elements are true.
Example: (x==4 && y==1).
* OR (||): True when at least one of the elements is true.
Example: (x==4 || y==1).
* NOT (!): This toggles a statement from true to false or from false to true.
Example: (x==4 || !(y==1)). This example is true if x is 4 OR y is NOT 1.