title: How can I replace array item with matched object keys?
body: <p>Let's say I have an array of id's
  <code>const ids = [[1, 2, 3], [2, 3], [3]]</code></p>
  <p>And have array with objects that have name for each id</p>
  <pre><code>const obj = [
      { id: 1, name: &quot;One&quot; },
      { id: 2, name: &quot;Two&quot; },
      { id: 3, name: &quot;Three&quot; },
    ];
  </code></pre>
  <p>What is the most proper way to get <code>ids = [[&quot;One&quot;, &quot;Two&quot;, &quot;Three&quot;], [&quot;Two&quot;, &quot;Three&quot;], [&quot;Three&quot;]]</code>, I'm worrying that nested mapping could cause performance issues.</p>