title: Remove duplicates from parsed CSV array
body: <p>I made progress with this based on a previous question, but got one last hurdle.  I have the following data in a csv.</p>
  
  <pre><code>this_year   |   minus_one_year  |   minus_two_year  |   minus_three_year
  -------------------------------------------------------------------------
  1           |   2               |   2               |   3
  -------------------------------------------------------------------------
  4           |   5               |   5               |   5
  -------------------------------------------------------------------------
  2           |   2               |   2               |   2
  -------------------------------------------------------------------------
  4           |   5               |   4               |   4
  -------------------------------------------------------------------------
  1           |   2               |   3               |   3
  -------------------------------------------------------------------------
  </code></pre>
  
  <p>I read this csv file and now I need produce nodes.  A node contains a node (column heading) along with the value.  So in the above data, you can see that this_year has 3 distinct
  values, 1, 2 and 4, so the nodes for this should look like this.</p>
  
  <pre><code>{
    "nodes": [
      {
        "name": "1",
        "node": "this_year"
      },
      {
        "name": "2",
        "node": "this_year"
      },
      {
        "name": "4",
        "node": "this_year"
      }
    ]
  }
  </code></pre>
  
  <p>The other nodes for the other columns should also be produced.  So far I have this</p>
  
  <pre><code>d3.csv('my_csv.csv')
      .then(function(data) {
  
          let graph = {"nodes" : [], "links" : []};
  
          graph.nodes = data.reduce(function(acc, line){
              return acc.concat(Object.entries(line).map(function(column){
                  return {name: column[0], node: column[1]}
              }))}, [])
              .sort(function (n1, n2) {
                  return d3.ascending(n1.name, n2.name);
              });
  
          console.log('nodes:', JSON.stringify(graph.nodes));
  
      }).catch(function(error){
  });
  </code></pre>
  
  <p>This produces the following</p>
  
  <pre><code>[
    {
      "name": "this_year",
      "node": "1"
    },
    {
      "name": "this_year",
      "node": "4"
    },
    {
      "name": "this_year",
      "node": "2"
    },
    {
      "name": "this_year",
      "node": "4"
    },
    {
      "name": "this_year",
      "node": "1"
    }
  ]
  </code></pre>
  
  <p>So it has the correct format, but it is outputting the duplicates, it should only contain one each for 1, 2 and 4.  How can I remove these duplicates?  I have looked at reduceRight,
  is this something I can use?</p>
  
  <p>Thanks</p>