<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://wbex.ru/index.php?action=history&amp;feed=atom&amp;title=JavaScript_Tutorial%2FOperators%2FBoolean_Operators</id>
		<title>JavaScript Tutorial/Operators/Boolean Operators - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://wbex.ru/index.php?action=history&amp;feed=atom&amp;title=JavaScript_Tutorial%2FOperators%2FBoolean_Operators"/>
		<link rel="alternate" type="text/html" href="http://wbex.ru/index.php?title=JavaScript_Tutorial/Operators/Boolean_Operators&amp;action=history"/>
		<updated>2026-04-04T15:17:09Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://wbex.ru/index.php?title=JavaScript_Tutorial/Operators/Boolean_Operators&amp;diff=9157&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://wbex.ru/index.php?title=JavaScript_Tutorial/Operators/Boolean_Operators&amp;diff=9157&amp;oldid=prev"/>
				<updated>2010-05-26T08:24:51Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 08:24, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://wbex.ru/index.php?title=JavaScript_Tutorial/Operators/Boolean_Operators&amp;diff=9156&amp;oldid=prev</id>
		<title> в 18:52, 25 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://wbex.ru/index.php?title=JavaScript_Tutorial/Operators/Boolean_Operators&amp;diff=9156&amp;oldid=prev"/>
				<updated>2010-05-25T18:52:56Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== JavaScript provides three Boolean operators==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;JavaScript defines true as anything other than 0 (zero), &amp;quot;&amp;quot; (empty string), null, undefined, and false.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Logical AND (&amp;amp;&amp;amp; )&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The logical AND operator (&amp;amp;&amp;amp;) returns true if the expression to the both sides of the operator evaluates to true.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;If either the left, right, or both expressions evaluate to false, the result of the operation is false.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The AND operation begins by evaluating the left operand.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;If the left operand evaluates false, the basic logic of the AND operator is complete.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;But if the left operand evaluates true, the right operand must be evaluated.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Logical OR&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The logical OR operator (||) returns false if the expression to the both sides of the operator evaluates to false.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;If one of the left and the right expressions evaluate to true, the result of the operation is true.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The OR operation begins by evaluating the left operand.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;If the left operand evaluates true, the basic logic of the OR operator is complete.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;But if the left operand evaluates false, the right operand must be evaluated.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Logical NOT&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;If the expression evaluates to true, the result of the logical NOT operator (!) is false.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;If the expression evaluates to false, the result is true.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;When the expression evaluates to a non-Boolean value, it is converted to true or false before performing the inversion.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Identity&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;If the value on the left is equal to the value on the right side of the operator, true is returned from the identity operator (===).&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;If the values are not equal, false is returned.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;No type-conversion is performed on the operands before the comparison.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Non-Identity&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;If the value on the left is not equal to the value on the right side of the operator, true is returned from the non-identity operator (!==).&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;If the values are equal, false is returned.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;No type-conversion is performed on the operands before the comparison is made.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The identity and non-identity operators are only available in JavaScript 1.3 and later.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;script language=&amp;quot;JavaScript&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;!--&lt;br /&gt;
    x = 3;&lt;br /&gt;
    if((2==x) &amp;amp;&amp;amp; (x=5)) {&lt;br /&gt;
      document.write(&amp;quot;The &amp;amp;&amp;amp; evaluated TRUE!&amp;lt;br&amp;gt;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
      document.write(&amp;quot;The &amp;amp;&amp;amp; evaluated FALSE!&amp;lt;br&amp;gt;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    document.write(&amp;quot;x=&amp;quot;,x,&amp;quot;&amp;lt;br&amp;gt;&amp;quot;);&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    &amp;lt;/script&amp;gt;&lt;br /&gt;
    &amp;lt;/html&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== Logical AND==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The logical AND operator in JavaScript is indicated by the double ampersand (&amp;amp;&amp;amp;):&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var bTrue = true;&lt;br /&gt;
var bFalse = false;&lt;br /&gt;
var bResult = bTrue &amp;amp;&amp;amp; bFalse;&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&amp;lt;p&amp;gt;Logical AND behaves as described in the following truth table:&amp;lt;/p&amp;gt;&lt;br /&gt;
Operand 1&lt;br /&gt;
Operand 2&lt;br /&gt;
Result&lt;br /&gt;
true&lt;br /&gt;
true&lt;br /&gt;
true&lt;br /&gt;
true&lt;br /&gt;
false&lt;br /&gt;
false&lt;br /&gt;
false&lt;br /&gt;
true&lt;br /&gt;
false&lt;br /&gt;
false&lt;br /&gt;
false&lt;br /&gt;
false&lt;br /&gt;
&lt;br /&gt;
== ! (Logical NOT)==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The logical NOT operator is indicated by an exclamation point (!).&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The logical NOT always returns a Boolean value.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The logical NOT operator behaves in the following way:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;OL&amp;gt;&amp;lt;LI&amp;gt;If the operand is an object, false is returned.&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;If the operand is the number 0, true is returned.&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;If the operand is any number other than 0, false is returned.&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;If the operand is null, true is returned.&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;If the operand is NaN, true is returned.&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;If the operand is undefined, an error occurs.&amp;lt;/LI&amp;gt;&amp;lt;/OL&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
    &amp;lt;script language=&amp;quot;JavaScript&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;!--&lt;br /&gt;
    theTruth = new String(&amp;quot;1&amp;quot;);&lt;br /&gt;
    theReverseTruth = !theTruth;&lt;br /&gt;
    document.write(&amp;quot;theTruth = &amp;quot;,theTruth,&amp;quot;&amp;lt;br&amp;gt;&amp;quot;);&lt;br /&gt;
    document.write(&amp;quot;theReverseTruth = &amp;quot;,theReverseTruth);&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
    &amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== || (Logical OR)==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The logical OR operator in JavaScript is the same as in Java, using the double pipe (||):&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var bTrue = true;&lt;br /&gt;
var bFalse = false;&lt;br /&gt;
var bResult = bTrue || bFalse;&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&amp;lt;p&amp;gt;Logical OR behaves as described in the following truth table:&amp;lt;/p&amp;gt;&lt;br /&gt;
Operand 1&lt;br /&gt;
Operand 2&lt;br /&gt;
Result&lt;br /&gt;
true&lt;br /&gt;
true&lt;br /&gt;
true&lt;br /&gt;
true&lt;br /&gt;
false&lt;br /&gt;
true&lt;br /&gt;
false&lt;br /&gt;
true&lt;br /&gt;
true&lt;br /&gt;
false&lt;br /&gt;
false&lt;br /&gt;
false&lt;br /&gt;
&lt;br /&gt;
== Use logical NOT to control the loop==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var bFound = false;&lt;br /&gt;
var i = 0;&lt;br /&gt;
while (!bFound) {&lt;br /&gt;
    if (aValues[i] == vSearchValue) {&lt;br /&gt;
        bFound = true;&lt;br /&gt;
    } else {&lt;br /&gt;
        i++;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
			</entry>

	</feed>