title: What does a square-bracketed index after an NSArray mean?
body: <p>Going through iTunes U Developing iOS 7 Apps for iPhone and iPad and in Lecture 3 slides, on page 120, there's a Quiz question that asks what the following line of code does. Frankly, I'm a bit stumped, and hoped someone could break it down.</p>
  
  <pre><code>cardA.contents = @[cardB.contents,cardC.contents][[cardB match:@[cardC]] ? 1 : 0];
  </code></pre>
  
  <p>So, I get the first part, <code>cardA.contents =</code> a new array with <code>cardB.contents</code> and <code>cardC.contents</code> in the array. But, next comes (I guess??) an index that returns either 1 or 0 depending if <code>cardB</code> matches an array that includes <code>cardC</code>.</p>
  
  <p>Here's what I don't "get", and maybe it's just a syntax issue.... is what this does?</p>
  
  <p>How is</p>
  
  <pre><code>cardA.contents = @[cardB.contents,cardC.contents][0];
  </code></pre>
  
  <p>or</p>
  
  <pre><code>cardA.contents = @[cardB.contents,cardC.contents][1];
  </code></pre>
  
  <p>Valid? Or, did I miss something?</p>