I have an object like this:

```
result: 
     > rows:
       > 0: {key: Array(4), value: 3}
          > key: (4) ["Person", "2020-06-24", "Product, "00000000008"]
            value: 3
       > 1: {key: Array(4), value: 10}
          > key: (4) ["Person", "2020-06-25", "Product, "00000000009"]
            value: 10
       > 2: {key: Array(4), value: 10}
          > key: (4) ["Person", "2020-06-25", "Product, "00000000008"]
            value: 10

```

Now, what I need to do is to reduce this result checking for the same code (for example 00000000008) and sum the value, to obtain:

(for example)

```
00000000008   value: 13

```

Now, my problem is how to do, I have tried to use first a map and then a reduce, but I don't understand how can I check for the same code and sum the value.

How can I do?

I have tried in this way, but it doesn't work:

`res` is the object with the values

```
let example = res.rows.map((element)=> {
        console.log("ELEMENT IS ", element)
        let example1 = element.key[3].reduce(function(element, v){
          if(ref.hasOwnProperty(v))
            element[ref[v]] += v;
          else {
            ref[v] = element.length;
            element.push(prev = v)
          }
          return element
        }, [])
      })
      console.log("element", element)

```