title: ko.utils.arrayMap, but only return part of the array
body: <p>I am using some of the Knockout utility functions described brilliantly here: <a href="http://www.knockmeout.net/2011/04/utility-functions-in-knockoutjs.html" rel="noreferrer">http://www.knockmeout.net/2011/04/utility-functions-in-knockoutjs.html</a></p>
  
  <p>I want to do an arrayMap to select certain properties based on a condition, e.g.</p>
  
  <pre><code>return ko.utils.arrayMap(myObservableArray(), function (item) {
      return item.Label;
  });
  </code></pre>
  
  <p>Say for example this produces the following output:</p>
  
  <pre><code>[null, "", "SomeLabel", null, "SomeOtherLabel"]
  </code></pre>
  
  <p>I want to select the properties based on a condition, so I try: </p>
  
  <pre><code>return ko.utils.arrayMap(myObservableArray(), function (item) {
      if (item.Label &amp;&amp; item.Label !== "") {
          return item.Label;
      }
  });
  </code></pre>
  
  <p>However then you end up with an array like:</p>
  
  <pre><code>[undefined, undefined, "SomeLabel", undefined, "SomeOtherLabel"]
  </code></pre>
  
  <p>I've also tried this:</p>
  
  <pre><code>return ko.utils.arrayMap(myObservableArray(), function (item) {
      return (item.Label &amp;&amp; item.Label !== "") ? item.Label : false;
  });
  </code></pre>
  
  <p>but you get:</p>
  
  <pre><code>[false, false, "SomeLabel", false, "SomeOtherLabel"]
  </code></pre>
  
  <p>So I am then having to do:</p>
  
  <pre><code>var itemsWithLabels = ko.utils.arrayFilter(myObservableArray(), function (item) {
      return (item.Label &amp;&amp; item.Label !== "");
  });
  return ko.utils.arrayMap(itemsWithLabels, function (item) {
      return item.Label;
  });
  </code></pre>
  
  <p>Which will give me:</p>
  
  <pre><code>["SomeLabel", "SomeOtherLabel"]
  </code></pre>
  
  <p>Is there a more efficient way of accomplishing this, in one shot, using ko.utils or similar?</p>