{"action":"created","issue":{"url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/issues/10311","repository_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp","labels_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/issues/10311/labels{/name}","comments_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/issues/10311/comments","events_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/issues/10311/events","html_url":"https://github.com/FreeCodeCamp/FreeCodeCamp/issues/10311","id":172588420,"number":10311,"title":"Sorted Union","user":{"login":"jem243","id":21025843,"avatar_url":"https://avatars.githubusercontent.com/u/21025843?v=3","gravatar_id":"","url":"https://api.github.com/users/jem243","html_url":"https://github.com/jem243","followers_url":"https://api.github.com/users/jem243/followers","following_url":"https://api.github.com/users/jem243/following{/other_user}","gists_url":"https://api.github.com/users/jem243/gists{/gist_id}","starred_url":"https://api.github.com/users/jem243/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jem243/subscriptions","organizations_url":"https://api.github.com/users/jem243/orgs","repos_url":"https://api.github.com/users/jem243/repos","events_url":"https://api.github.com/users/jem243/events{/privacy}","received_events_url":"https://api.github.com/users/jem243/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-08-23T00:50:57Z","updated_at":"2016-08-23T04:13:07Z","closed_at":"2016-08-23T04:13:07Z","body":"Challenge [Sorted Union](https://www.freecodecamp.com/challenges/sorted-union#?solution=%2F%2FJeremy%20This%20code%20works%20there%20is%20a%20bug%20in%20there%20system...%20all%20my%20test%20come%20out%20right.%0Afunction%20uniteUnique(arr)%20%7B%0A%20%20var%20newArr%3B%0A%20%20%0A%20%20function%20addToArray(val)%20%7B%0A%20%20%20%20if(newArr%20%3D%3D%3D%20undefined)%7B%20%2F%2Fif%20my%20array%20is%20blank%20post%20array%20numbers%20into%20new%20array.%0A%20%20%20%20%20%20newArr%20%3D%20val%3B%0A%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%2F%2Fwe%20need%20to%20run%20testing%20and%20post%20new%20values%20of%20the%20next%20array.%0A%20%20%20%20%20%20for(j%20%3D%200%3B%20j%20%3C%20val.length%3B%20j%2B%2B)%20%7B%2F%2Frun%20a%20loop%20over%20all%20the%20new%20values.%0A%20%20%20%20%20%20%20%20%20if(checkSome(val%5Bj%5D))%20%7B%0A%20%20%20%20%20%20%20%20%20%2F%2Fthen%20it%20returns%20true%20and%20it%20already%20exhists%20in%20my%20new%20Array.%0A%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%2F%2Fit%20doesn't%20and%20we%20need%20to%20push%20it%20to%20the%20end%20of%20the%20array.%0A%20%20%20%20%20%20%20%20%20%20%20newArr.push(val%5Bj%5D)%3B%0A%20%20%20%20%20%20%20%20%20%7D%20%20%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%0A%20%20%0A%20%20function%20checkSome(val2)%20%7B%0A%20%20%20%20return%20newArr.indexOf(val2)%20%3E%20-1%3B%0A%20%20%7D%0A%20%20%2F%2Frun%20thru%20all%20the%20arrays.%0A%20%20for%20(var%20i%20%3D%200%3B%20i%20%3C%20arr.length%3B%20i%2B%2B)%20%7B%0A%20%20%20%20addToArray(arr%5Bi%5D)%3B%0A%20%20%7D%0A%20%20%0A%20%20return%20newArr%3B%0A%7D%0A%20%20%0A%2F%2Fa%20simple%20test%20of%20just%20running%20arr%20only%20returns%20%5B1%2C3%2C2%5D%3B%0A%2F%2Fthere%20is%20an%20error%20in%20the%20excercise%20similiar%20to%20destroyer%20excercise.%0AuniteUnique(%5B%5B1%2C%202%2C%203%5D%2C%20%5B5%2C%202%2C%201%2C%204%5D%2C%20%5B2%2C%201%5D%2C%20%5B6%2C%207%2C%208%5D%5D)%3B%20%2F%2Fi%20have%20to%20add%20%5B%5D%20to%20get%20the%20whole%20amount%20%0A) has an issue.\r\nUser Agent is: <code>Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 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\n//Jeremy This code works there is a bug in there system... all my tests sent thru come out right.\r\n//Display but I can't pass the test.\r\n\r\nfunction uniteUnique(arr) {\r\n  var newArr;\r\n  \r\n  function addToArray(val) {\r\n    if(newArr === undefined){ //if my array is blank post array numbers into new array.\r\n      newArr = val;\r\n    } else {\r\n      //we need to run testing and post new values of the next array.\r\n      for(j = 0; j < val.length; j++) {//run a loop over all the new values.\r\n         if(checkSome(val[j])) {\r\n         //then it returns true and it already exhists in my new Array.\r\n         continue;\r\n         } else {\r\n           //it doesn't and we need to push it to the end of the array.\r\n           newArr.push(val[j]);\r\n         }  \r\n      }\r\n    }\r\n  }\r\n  \r\n  function checkSome(val2) {\r\n    return newArr.indexOf(val2) > -1;\r\n  }\r\n  //run thru all the arrays.\r\n  for (var i = 0; i < arr.length; i++) {\r\n    addToArray(arr[i]);\r\n  }\r\n  \r\n  return newArr;\r\n}\r\n  \r\n//a simple test of just running arr only returns [1,3,2]; and not the true variable of [1, 2, 3], [5, 2, 1, 4], [2, 1], [6, 7, 8] \r\n//there is an error in the excercise similiar to destroyer excercise.\r\nuniteUnique([[1, 2, 3], [5, 2, 1, 4], [2, 1], [6, 7, 8]]); //i have to add [] to get the whole amount \r\n\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/issues/comments/241621976","html_url":"https://github.com/FreeCodeCamp/FreeCodeCamp/issues/10311#issuecomment-241621976","issue_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/issues/10311","id":241621976,"user":{"login":"erictleung","id":2754821,"avatar_url":"https://avatars.githubusercontent.com/u/2754821?v=3","gravatar_id":"","url":"https://api.github.com/users/erictleung","html_url":"https://github.com/erictleung","followers_url":"https://api.github.com/users/erictleung/followers","following_url":"https://api.github.com/users/erictleung/following{/other_user}","gists_url":"https://api.github.com/users/erictleung/gists{/gist_id}","starred_url":"https://api.github.com/users/erictleung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erictleung/subscriptions","organizations_url":"https://api.github.com/users/erictleung/orgs","repos_url":"https://api.github.com/users/erictleung/repos","events_url":"https://api.github.com/users/erictleung/events{/privacy}","received_events_url":"https://api.github.com/users/erictleung/received_events","type":"User","site_admin":false},"created_at":"2016-08-23T04:13:06Z","updated_at":"2016-08-23T04:13:06Z","body":"@jem243 thanks for the issue. The seed code that the challenge starts with is correct. It is intentional that there is only \"one\" parameter, `arr`. Please see the helpful link listed to help, particularly the [Arguments Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments) link. That will help answer your questions on how to deal with just \"one\" input parameter. As @haih has pointed out, please consult the help room first before making issues. Happy coding!"}}
{"actor":{"display_login":"erictleung"}}