title: What is the best way to return single object instead of array from jQuery selection?
body: <p>Newb question:</p>
  
  <p>jQuery('.foo')[0] does the job most of the time.
  jQuery('.foo:first')[0] is slightly more explicit and performant.
  But this isn't nice when array is empty, so check is necessary.</p>
  
  <p>But is there a better way than to use array indexer? i.e. return is a single object or null if not found.</p>
  
  <p>I know it's by design an array is always returned as jQuery's power lies in the "set" operations. But sometimes a more concise syntax does help readability and avoid bugs.</p>