title: Sort an array of objects based on another array of ids
body: <p>I have 2 arrays</p>
  
  <pre><code>a = [2,3,1,4]
  b = [{id: 1}, {id: 2}, {id: 3}, {id: 4}]
  </code></pre>
  
  <p>How do I get <code>b</code> sorted based on <code>a</code>? My desired output would be</p>
  
  <pre><code>c = [{id: 2}, {id: 3}, {id: 1}, {id: 4}]
  </code></pre>
  
  <p>I would prefer to use Ramda or regular JS.</p>