Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Comma is a separate <a href="https://developer.mozilla.org/en/JavaScript/Reference/Operators/Comma_Operator" rel="nofollow">operator</a> in javascript:</p> <blockquote> <p>The comma operator evaluates both of its operands (from left to right) and returns the value of the second operand.</p> </blockquote> <p>You have grasped just a part of expression:</p> <blockquote> <p>Then there's 63 &lt;= a &amp;&amp; 77 >= a ? a = 65 : 48 </p> </blockquote> <p>Actually it is a little bit longer (with some formatting):</p> <pre><code>63 &lt;= a &amp;&amp; 77 &gt;= a ? a = 65 : 48 &lt;= a &amp;&amp; 57 &gt;= a ? a = 48 : c &amp; 1 ? 97 &lt;= a &amp;&amp; 122 &gt;= a ? a = 65 : 197 == a || 229 == a ? c &amp;= 5 : 192 &lt;= a &amp;&amp; 687 &gt;= a ? a = 192 : 1536 &lt;= a ? a = 1536 : 912 &lt;= a ? a = 912 : 160 &lt;= a ? a = 160 : 127 &lt;= a ? c &amp;= 5 : 33 &lt;= a ? a = 59 : c &amp;= 5 : 48 &gt; a ? c &amp;= 5 : 65 &gt; a ? a = 59 : 96 &gt; a ? c &amp;= 5 : 112 &gt; a ? a = 96 : 187 &gt; a ? c &amp;= 5 : a = 59 </code></pre> <p>Trying to rewrite it in if-else fasion will yield the following result:</p> <pre><code>if (63 &lt;= a &amp;&amp; 77 &gt;= a){ a = 65 } else if (48 &lt;= a &amp;&amp; 57 &gt;= a){ a = 48 } else if (c &amp; 1){ if (97 &lt;= a &amp;&amp; 122 &gt;= a){ a = 65 } else if (197 == a || 229 == a){ c &amp;= 5 } else if (192 &lt;= a &amp;&amp; 687 &gt;= a){ a = 192 } else if (1536 &lt;= a){ a = 1536 } else if (912 &lt;= a){ a = 912 } else if (160 &lt;= a){ a = 160 } else if (127 &lt;= a){ c &amp;= 5 } else if (33 &lt;= a){ a = 59 } else { c &amp;= 5 } } else { if (48 &gt; a){ c &amp;= 5 } else if (65 &gt; a){ a = 59 } else if (96 &gt; a){ c &amp;= 5 } else if (112 &gt; a){ a = 96 } else if (187 &gt; a){ c &amp;= 5 } else { a = 59 } } </code></pre> <p>Please, <strong>pay attention</strong> that if-else approach lacks returning value currently, whereas ternary operator does return the value of the last operator executed (this may affect the overall value of boolean expression in parentheses).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload