title: How to use one-liner if without else statement in .map() in Javascript?
body: <p>I have an issue which I do not how to resolve.</p>
  <p>I want to map data with <code>.map((x) =&gt; x.data)</code> with one-liner if statement inside, but without any else statement. I would like to achieve more or else 'pass' just as in Python.</p>
  <p>In example:</p>
  <p>What I want:</p>
  <pre><code>let mappedData = data.map((x) =&gt; x.data === filters.data ? [x.value, x.name, x.category]: pass);
  </code></pre>
  <p>This should return <code>mappedData</code> with data that only fill the condition.</p>
  <p>When I use sth like this</p>
  <pre><code>let mappedData = data.map((x) =&gt; x.data === filters.data ? [x.value, x.name, x.category]: {});
  </code></pre>
  <p>It returns array of size data and with empty dicts if condition is not filled.</p>
  <p>I tried as well sth like this:</p>
  <pre><code>let mappedData = data.map((x) =&gt; x.data === filters.data &amp;&amp; [x.value, x.name, x.category]);
  </code></pre>
  <p>But that gives me <code>false</code> at each index that does not fill the condition.</p>
  <p>I really would like to do one-liner if possible.</p>
  <p>Thanks guys</p>