title: Can I do a generic chainable proc with jQuery?
body: <p>I have this block :</p>
  
  <pre><code>          return $( "&lt;li&gt;&lt;/li&gt;" )
                .data( "item.autocomplete", item )
                .append( "&lt;a&gt;" + item.label + "&lt;/a&gt;" )
                .appendTo( ul );
          };
  </code></pre>
  
  <p>And I want to put a ternary in the <code>append</code> statement so that its either just a <code>label</code> or a <code>label with an address</code></p>
  
  <pre><code>item.address != '' ? item.address : ''
  </code></pre>
  
  <p>or a little messier but more specific..</p>
  
  <pre><code>if ( item.address != '' )
    "&lt;span class='customer_search_addr'&gt;" + item.address + "&lt;/span&gt;"
  else
    "&lt;a&gt;" + item.label + "&lt;/a&gt;" 
  </code></pre>
  
  <p>Can I make a chainable proc here since I can't ( I don't think I can ) add this ternary directly within an append statement.</p>