title: How to get an array from number positions of other array?
body: <p>I have an array <code>A = [1,3]</code> - which stores positions of correct answers from another array <code>B = [&quot;answer1&quot;,&quot;answer2&quot;,&quot;answer3&quot;,&quot;answer4&quot;]</code>.
  I need to get an array <strong>C</strong> which will be consist from the correct answers, something like this <code>[&quot;answer1&quot;,&quot;answer3&quot;]</code>.</p>
  <p>Example: If array <strong>A</strong> consist from 1 element (for example <code>A = [2]</code>), then array <strong>C</strong> should look like <code>C = [&quot;answer2&quot;]</code>.</p>
  <p>I can solve this problem with <code>indexOf()</code>, when I have an array <strong>A</strong> consisting from 1 element. But when there are 2 or more elements I'm getting stuck</p>