title: Javascript syntax Help on sorting function
body: <h2>Code</h2>
  
  <pre><code>function SortByID(x,y) {
      return x.id - y.id;
  }
  
  function SortByName(x,y) {
      return ((x.Name == y.Name) ? 0 : ((x.Name &gt; y.Name)? 1: -1));
  }
  </code></pre>
  
  <h2>Problem Description</h2>
  
  <p>I am new to Javascript and I am learning how to make a sorting algorithm. I have a few questions regarding the two functions above. </p>
  
  <p>1.Can you please explain the line of code below to me in words? </p>
  
  <pre><code>return ((x.Name == y.Name) ? 0 : ((x.Name &gt; y.Name)? 1: -1));
  </code></pre>
  
  <p>2.What does the question mark in the above code mean?</p>
  
  <p>3.what doest the "? 1: -1" and "? 0 :" means?</p>
  
  <p>Many Thanks!</p>