{"action":"created","issue":{"url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/issues/4134","labels_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/issues/4134/labels{/name}","comments_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/issues/4134/comments","events_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/issues/4134/events","html_url":"https://github.com/FreeCodeCamp/FreeCodeCamp/issues/4134","id":114645740,"number":4134,"title":"Bonfire: Confirm the Ending - A test case requests true for what should be false.","user":{"login":"av-7","id":9023987,"avatar_url":"https://avatars.githubusercontent.com/u/9023987?v=3","gravatar_id":"","url":"https://api.github.com/users/av-7","html_url":"https://github.com/av-7","followers_url":"https://api.github.com/users/av-7/followers","following_url":"https://api.github.com/users/av-7/following{/other_user}","gists_url":"https://api.github.com/users/av-7/gists{/gist_id}","starred_url":"https://api.github.com/users/av-7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/av-7/subscriptions","organizations_url":"https://api.github.com/users/av-7/orgs","repos_url":"https://api.github.com/users/av-7/repos","events_url":"https://api.github.com/users/av-7/events{/privacy}","received_events_url":"https://api.github.com/users/av-7/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-11-02T17:40:32Z","updated_at":"2015-12-27T22:21:02Z","closed_at":"2015-11-02T18:05:13Z","body":"Challenge [Bonfire: Confirm the Ending](http://www.freecodecamp.com/challenges/bonfire-confirm-the-ending#?solution=function%20end(str%2C%20target)%20%7B%0A%20%20%2F%2F%20%22Never%20give%20up%20and%20good%20luck%20will%20find%20you.%22%0A%20%20%2F%2F%20--%20Falcor%0A%20%20var%20n%20%3D%20str.split(%22%20%22)%3B%0A%20%20%0A%20%20if%20(str.slice(-1)%20%3D%3D%3D%20target%20%7C%7C%20n%5Bn.length%20-%201%5D%20%3D%3D%3D%20target)%20%7B%0A%20%20%20%20return%20true%3B%20%20%0A%20%20%7D%20else%20%7B%0A%20%20%20%20return%20false%3B%0A%20%20%7D%0A%20%20%0A%7D%0A%0Aend(%22Bastian%22%2C%20%22n%22)%3B%0A) has an issue.\r\nUser Agent is: <code>Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36</code\r\n![capture](https://cloud.githubusercontent.com/assets/9023987/10889052/7d1e87f8-8144-11e5-9b11-476a5b30df08.JPG)\r\n>.\r\nPlease describe how to reproduce this issue, and include links to screenshots if possible.\r\n\r\nThe test case shown in the screenshot asserts true, where it should be false. If we are matching the last character or word in a string with the target, then you can clearly see it in the case \r\n\r\n    end(\"He has to give me a new name\", \"me\") should return true.\r\n\r\nthat the **last word \"name\" is not same as the target \"me\"**.\r\n\r\nMy code:\r\n```javascript\r\nfunction end(str, target) {\r\n  // \"Never give up and good luck will find you.\"\r\n  // -- Falcor\r\n  var n = str.split(\" \");\r\n  \r\n  if (str.slice(-1) === target || n[n.length - 1] === target) {\r\n    return true;  \r\n  } else {\r\n    return false;\r\n  }\r\n  \r\n}\r\n\r\nend(\"Bastian\", \"n\");\r\n\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/issues/comments/167444975","html_url":"https://github.com/FreeCodeCamp/FreeCodeCamp/issues/4134#issuecomment-167444975","issue_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/issues/4134","id":167444975,"user":{"login":"utkarshyadav5","id":15573305,"avatar_url":"https://avatars.githubusercontent.com/u/15573305?v=3","gravatar_id":"","url":"https://api.github.com/users/utkarshyadav5","html_url":"https://github.com/utkarshyadav5","followers_url":"https://api.github.com/users/utkarshyadav5/followers","following_url":"https://api.github.com/users/utkarshyadav5/following{/other_user}","gists_url":"https://api.github.com/users/utkarshyadav5/gists{/gist_id}","starred_url":"https://api.github.com/users/utkarshyadav5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/utkarshyadav5/subscriptions","organizations_url":"https://api.github.com/users/utkarshyadav5/orgs","repos_url":"https://api.github.com/users/utkarshyadav5/repos","events_url":"https://api.github.com/users/utkarshyadav5/events{/privacy}","received_events_url":"https://api.github.com/users/utkarshyadav5/received_events","type":"User","site_admin":false},"created_at":"2015-12-27T22:21:02Z","updated_at":"2015-12-27T22:21:02Z","body":"function end(str, target) {\r\n// \"Never give up and good luck will find you.\"\r\n// -- Falcor\r\nvar len=target.length;\r\nif(target==str.substr(-len,len)){\r\nreturn true;\r\n}else{\r\nreturn false;\r\n}\r\n\r\n}\r\nend(\"Bastian\", \"n\");\r\n\r\nThe right answer for the question using the hint given.\r\n\r\n"}}