{"action":"opened","issue":{"url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/issues/7914","repository_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp","labels_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/issues/7914/labels{/name}","comments_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/issues/7914/comments","events_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/issues/7914/events","html_url":"https://github.com/FreeCodeCamp/FreeCodeCamp/issues/7914","id":145935709,"number":7914,"title":"I think it's a bug, Diff Two Arrays or may be not, please I would like some help.","user":{"login":"tushar3112","id":17554363,"avatar_url":"https://avatars.githubusercontent.com/u/17554363?v=3","gravatar_id":"","url":"https://api.github.com/users/tushar3112","html_url":"https://github.com/tushar3112","followers_url":"https://api.github.com/users/tushar3112/followers","following_url":"https://api.github.com/users/tushar3112/following{/other_user}","gists_url":"https://api.github.com/users/tushar3112/gists{/gist_id}","starred_url":"https://api.github.com/users/tushar3112/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tushar3112/subscriptions","organizations_url":"https://api.github.com/users/tushar3112/orgs","repos_url":"https://api.github.com/users/tushar3112/repos","events_url":"https://api.github.com/users/tushar3112/events{/privacy}","received_events_url":"https://api.github.com/users/tushar3112/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-05T09:34:53Z","updated_at":"2016-04-05T09:34:53Z","closed_at":null,"body":"Challenge [Diff Two Arrays](https://www.freecodecamp.com/challenges/diff-two-arrays#?solution=function%20diff(arr1%2C%20arr2)%20%7B%0A%20%20var%20newArr%20%3D%20%5B%5D%3B%0A%20%20%2F%2F%20Same%2C%20same%3B%20but%20different.%0A%20for%20(var%20i%20%3D%200%3Bi%3Carr1.length%3Bi%2B%2B)%20%7B%0A%20%20%20if(arr2.indexOf(arr1%5Bi%5D)%20%3D%3D%3D%20-1)%20%7B%0A%20%20%20%20%20newArr.push(arr1%5Bi%5D)%3B%0A%20%20%20%7D%0A%20%7D%0A%20%20for(var%20j%3D0%3Bj%3Carr2.length%3Bj%2B%2B)%20%7B%0A%20%20%20%20if(arr1.indexOf(arr2%5Bj%5D)%20%3D%3D%3D%20-1)%20%7B%0A%20%20%20%20%20%20newArr.push(arr2%5Bj%5D)%3B%0A%20%20%20%20%7D%0A%20%20%7D%0A%20%20return%20newArr%3B%0A%7D%0A%0Adiff(%5B1%2C%20%22calf%22%2C%203%2C%20%22piglet%22%5D%2C%20%5B1%2C%20%22calf%22%2C%203%2C%204%5D)%3B%0A) has an issue.\r\nUser Agent is: <code>Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36</code>.\r\nPlease describe how to reproduce this issue, and include links to screenshots if possible.\r\n\r\nMy code:\r\n```javascript\r\nfunction diff(arr1, arr2) {\r\n  var newArr = [];\r\n  // Same, same; but different.\r\n for (var i = 0;i<arr1.length;i++) {\r\n   if(arr2.indexOf(arr1[i]) === -1) {\r\n     newArr.push(arr1[i]);\r\n   }\r\n }\r\n  for(var j=0;j<arr2.length;j++) {\r\n    if(arr1.indexOf(arr2[j]) === -1) {\r\n      newArr.push(arr2[j]);\r\n    }\r\n  }\r\n  return newArr;\r\n}\r\n\r\ndiff([1, \"calf\", 3, \"piglet\"], [1, \"calf\", 3, 4]);\r\n\r\n```\r\n\r\nI tried to pass different values in the array and it is working, but I am not able to clear this challenge.\r\n\r\nIf I am doing something wrong, any help would be appreciated.\r\nI know there may be better ways of solving this particular challenge but right now I'm interested in what am I missing? or is it some kind of a bug?\r\n\r\n\r\n"}}