title: Operator precedence with JavaScript's ternary operator
body: <p>I can’t seem to wrap my head around the first part of this code ( += ) in combination with the <a href="https://en.wikipedia.org/wiki/%3F:" rel="nofollow noreferrer">ternary operator</a>.</p>
  <pre><code>h.className += h.className ? ' error' : 'error'
  </code></pre>
  <p>The way I think this code works is as follows:</p>
  <pre><code>h.className = h.className + h.className ? ' error' : 'error'
  </code></pre>
  <p>But that isn't correct, because that gives a error in my console.</p>
  <p>How should I interpret this code correctly?</p>