{"action":"closed","issue":{"url":"https://api.github.com/repos/FreeCodeCamp/freecodecamp/issues/1143","labels_url":"https://api.github.com/repos/FreeCodeCamp/freecodecamp/issues/1143/labels{/name}","comments_url":"https://api.github.com/repos/FreeCodeCamp/freecodecamp/issues/1143/comments","events_url":"https://api.github.com/repos/FreeCodeCamp/freecodecamp/issues/1143/events","html_url":"https://github.com/FreeCodeCamp/freecodecamp/issues/1143","id":91516827,"number":1143,"title":"Uncaught TypeError: Cannot set property 'err' of undefined","user":{"login":"Mathieu-Roy","id":5873950,"avatar_url":"https://avatars.githubusercontent.com/u/5873950?v=3","gravatar_id":"","url":"https://api.github.com/users/Mathieu-Roy","html_url":"https://github.com/Mathieu-Roy","followers_url":"https://api.github.com/users/Mathieu-Roy/followers","following_url":"https://api.github.com/users/Mathieu-Roy/following{/other_user}","gists_url":"https://api.github.com/users/Mathieu-Roy/gists{/gist_id}","starred_url":"https://api.github.com/users/Mathieu-Roy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mathieu-Roy/subscriptions","organizations_url":"https://api.github.com/users/Mathieu-Roy/orgs","repos_url":"https://api.github.com/users/Mathieu-Roy/repos","events_url":"https://api.github.com/users/Mathieu-Roy/events{/privacy}","received_events_url":"https://api.github.com/users/Mathieu-Roy/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-06-27T21:35:08Z","updated_at":"2015-08-12T02:57:31Z","closed_at":"2015-08-12T02:57:30Z","body":"Challenge http://www.freecodecamp.com/challenges/bonfire-inventory-update has an issue.\r\n\r\nThe following code returns the good value, but an error appears in the console nevertheless \"Uncaught TypeError: Cannot set property 'err' of undefined\", and then the page needs to be reloaded in order to be able to run new code.\r\n```\r\n// by mathieu_roy\r\nfunction inventory(arr1, arr2) {\r\n  // All inventory must be accounted for or you're fired!\r\n  arr = [];\r\n  for(var i in arr1) {\r\n    match = false;\r\n    for(var j in arr2) {\r\n      if(arr1[i][1] === arr2[j][1]) {\r\n        arr.push([arr1[i][0] + arr2[j][0], arr1[i][1]]);\r\n        console.log([arr1[i][0] + arr2[j][0], arr1[i][1]]);\r\n        match = true;\r\n        break;\r\n      }\r\n    }\r\n    if(!match) {\r\n      arr.push([arr1[i][0], arr1[i][1]]);\r\n      console.log([arr1[i][0], arr1[i][1]]);\r\n    }\r\n  }\r\n  \r\n  for(var k in arr2) {\r\n    match = false;\r\n    for(var l in arr1) {\r\n      if(arr2[k][1] === arr1[l][1]) {\r\n        match = true;\r\n        break;\r\n      }\r\n    }\r\n    if(!match) {\r\n      arr.push([arr2[k][0], arr2[k][1]]);\r\n      console.log([arr2[k][0], arr2[k][1]]);\r\n    }\r\n  }\r\n  \r\n  return arr;\r\n}\r\n\r\n// Example inventory lists\r\nvar curInv = [\r\n    [21, 'Bowling Ball'],\r\n    [2, 'Dirty Sock'],\r\n    [1, 'Hair Pin'],\r\n    [5, 'Microphone']\r\n];\r\n\r\nvar newInv = [\r\n    [2, 'Hair Pin'],\r\n    [3, 'Half-Eaten Apple'],\r\n    [67, 'Bowling Ball'],\r\n    [7, 'Toothpaste']\r\n];\r\n\r\ninventory(curInv, newInv);\r\n```\r\n\r\n![fcc - inventory update](https://cloud.githubusercontent.com/assets/5873950/8393936/14d3f040-1cf2-11e5-981e-43ac032822a5.png)"}}