title: Check if two keys have the same value inside a map function in React
body: <p>I am trying to check if the data I am getting from a report object has the same values under a certain key, so that I can build a chart with different labels of only one for each value I get.
  So far this is the code:</p>
  <pre><code>return (
  &lt;ChartDiv&gt;
    &lt;Bar
      data={{
        labels: [
          props.salesReports.map((label, i) =&gt; {
            //Check if I receive two of the same values
            return props.salesReports[i][4];
          }),
        ],
        datasets: [
          {
  .......
  </code></pre>
  <p>Does anyone know if this is possible to do directly inside .map() or if the data needs to be polished beforehand?
  Thanks!</p>