title: QML Array Undefined Check
body: <p>I am getting an array undefined error in QML and am wondering what will fix this error. Here is the current code:</p>
  
  <pre><code>opacity: mBitField[index]
  </code></pre>
  
  <p>every once and a while it will say cannot assign <code>undefined</code> to <code>opacity</code> and I am wondering if this fix is valid:</p>
  
  <pre><code>opacity: mBitField[index] == "undefined" ? 0 : mBitField[index]
  </code></pre>
  
  <p>Basically what I am trying to say is if the array is undefined it's ok to assign a 0 <code>opacity</code> otherwise assign whats in the array.</p>