title: Possible to conditionally $.map items in jQuery/Javascript
body: <p>Is it possible, to add a condition to the $.map in jquery?</p>
  
  <p>My code is:</p>
  
  <pre><code>var extrasToSave = $.map(self.extras(), function (extra) {
                  return {
                      Descr: extra.description,
                      Pr: extra.price,
                      Cnt: extra.count()
                  };
              });
  </code></pre>
  
  <p>I only want to map the object, if <code>extra.count()</code> is a number more than 0.  So pseudo code:</p>
  
  <pre><code>var extrasToSave = $.map(self.extras(), function (extra) {
             if (extra.count()&gt;0)
               {
                  return {
                      Descr: extra.description,
                      Pr: extra.price,
                      Cnt: extra.count()
                  };
                }
              });
  </code></pre>
  
  <p>Thank you,</p>
  
  <p>Mark</p>