title: The question mark operator in javascript
body: <p>can someone please explain the role of the ? in this function</p>
  
  <pre><code>function add() {
      h1.textContent = (hours ? (hours &gt; 9 ? hours : "0" + hours) : "00") + ":" + (minutes ? (minutes &gt; 9 ? minutes : "0" + minutes) : "00") + ":" + (seconds &gt; 9 ? seconds : "0" + seconds);
  }
  </code></pre>
  
  <p>I read that the ? works as follows varname = (condition) ? value1:value2. If the condition evaluates to true the variable becomes equal to value1 else value2.</p>
  
  <p>Which I understand. But i'm getting confused by the nested ? in the above and how to parse it...</p>