邏輯運算符號

回覆文章
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

邏輯運算符號

文章 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.
回覆文章

回到「Java Script」