title: How can I map an array with duplicate values to a unique array in Javascript?
body: <p>I have the following array:</p>
  
  <pre><code>var tst = 
  [
   {"topicId":1,"subTopicId":1,"topicName":"a","subTopicName":"w"},
   {"topicId":1,"subTopicId":2,"topicName":"b","subTopicName":"x"},
   {"topicId":1,"subTopicId":3,"topicName":"c","subTopicName":"y"},
   {"topicId":2,"subTopicId":4,"topicName":"c","subTopicName":"z"}
  ]
  </code></pre>
  
  <p>Is there an easy way that I can map that to this kind of array where topicId > id and topicName > name:</p>
  
  <pre><code>var t = 
  [
    {"id":1,"name":"a"},
    {"id":2,"name":"c"}
  ]
  </code></pre>
  
  <p>I am using a modern browser and I also have _lodash if that helps. Note that there will be about 100 rows in the tst array so I don't need a very optimized solution. A simple and easy to maintain solution would be more important. </p>