{"action":"created","issue":{"url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/issues/9689","repository_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp","labels_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/issues/9689/labels{/name}","comments_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/issues/9689/comments","events_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/issues/9689/events","html_url":"https://github.com/FreeCodeCamp/FreeCodeCamp/issues/9689","id":165061077,"number":9689,"title":"Bug,can't pass exam","user":{"login":"Wilson-lambda","id":19721900,"avatar_url":"https://avatars.githubusercontent.com/u/19721900?v=3","gravatar_id":"","url":"https://api.github.com/users/Wilson-lambda","html_url":"https://github.com/Wilson-lambda","followers_url":"https://api.github.com/users/Wilson-lambda/followers","following_url":"https://api.github.com/users/Wilson-lambda/following{/other_user}","gists_url":"https://api.github.com/users/Wilson-lambda/gists{/gist_id}","starred_url":"https://api.github.com/users/Wilson-lambda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wilson-lambda/subscriptions","organizations_url":"https://api.github.com/users/Wilson-lambda/orgs","repos_url":"https://api.github.com/users/Wilson-lambda/repos","events_url":"https://api.github.com/users/Wilson-lambda/events{/privacy}","received_events_url":"https://api.github.com/users/Wilson-lambda/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-12T11:52:25Z","updated_at":"2016-07-12T13:36:43Z","closed_at":null,"body":"Challenge [Finders Keepers](https://www.freecodecamp.com/challenges/finders-keepers#?solution=%0Afunction%20findElement(arr%2C%20func)%20%7B%0A%20%20var%20a%3D%20arr.filter(func)%3B%0A%20%20return%20a.length%3D%3D%3D0%3Fundefined%3Aa%3B%0A%7D%0A%0Avar%20b%3DfindElement(%5B1%2C%202%2C%203%2C%204%5D%2C%20function(num)%7B%20return%20num%20%25%202%20%3D%3D%3D%200%3B%20%7D)%3B%0Aconsole.log(b)%3B%0A) has an issue.\r\nUser Agent is: <code>Mozilla/5.0 (Windows NT 6.1; WOW64) 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\r\nfunction findElement(arr, func) {\r\n  var a= arr.filter(func);\r\n  return a.length===0?undefined:a;\r\n}\r\n\r\nvar b=findElement([1, 3, 5, 8, 9, 10], function(num) { return num % 2 === 0; }) //should return 8.\r\nconsole.log(b);\r\n\r\n```\r\n# it is bug,10 also is answer;\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/issues/comments/232049228","html_url":"https://github.com/FreeCodeCamp/FreeCodeCamp/issues/9689#issuecomment-232049228","issue_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/issues/9689","id":232049228,"user":{"login":"dhcodes","id":7917512,"avatar_url":"https://avatars.githubusercontent.com/u/7917512?v=3","gravatar_id":"","url":"https://api.github.com/users/dhcodes","html_url":"https://github.com/dhcodes","followers_url":"https://api.github.com/users/dhcodes/followers","following_url":"https://api.github.com/users/dhcodes/following{/other_user}","gists_url":"https://api.github.com/users/dhcodes/gists{/gist_id}","starred_url":"https://api.github.com/users/dhcodes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhcodes/subscriptions","organizations_url":"https://api.github.com/users/dhcodes/orgs","repos_url":"https://api.github.com/users/dhcodes/repos","events_url":"https://api.github.com/users/dhcodes/events{/privacy}","received_events_url":"https://api.github.com/users/dhcodes/received_events","type":"User","site_admin":false},"created_at":"2016-07-12T13:36:43Z","updated_at":"2016-07-12T13:36:43Z","body":"@Wilson-lambda I'm not sure the tests will pass if you modify the function at the bottom because I believe that is used for tests. I reset the code and used your findElement function and returned [8,10] for the first test. As you say, 10 does meet the criteria of being divisible by 2 with no remainder but the instructions say:\r\n\r\n> Create a function that looks through an array (first argument) and returns the **first element in the array** that passes a truth test\r\n\r\nSo in that case, you'll only want to return 8. Try asking in the [FCC Help Chat Room](https://gitter.im/FreeCodeCamp/HelpJavaScript) on Gitter if you need assistance."}}
{"actor":{"display_login":"dhcodes"}}