**Tell us what’s happening:**

I am trying to solve the inventory update challenge, but I am not passing the third, fifth and sixth tests even though I get the correct answers locally. I do not have any global variables I am using so I am probably missing something. What am I missing?

**Your code so far**

```
function updateInventory(arr1, arr2) {
let res = [];
// Update exising items
for (let i = 0; i < arr1.length; i ++) {
let existing = arr1[i];
let newItem = arr2.find(x => x[1] === existing[1])
res.push(existing);
if (newItem) {
res[i][0] = existing[0] + newItem[0]
}
}
// Appnend new items
for (let newItem of arr2) {
if (!res.map(x => x[1]).includes(newItem[1]))
res.push(newItem)
}
// Sort by abc
res = res.sort((a, b) => a[1] > b[1]);
return res
}
```

**Your browser information:**

User Agent is: `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36`

.