{"action":"opened","issue":{"url":"https://api.github.com/repos/searchforac/proj1/issues/2","labels_url":"https://api.github.com/repos/searchforac/proj1/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/searchforac/proj1/issues/2/comments","events_url":"https://api.github.com/repos/searchforac/proj1/issues/2/events","html_url":"https://github.com/searchforac/proj1/issues/2","id":115739745,"number":2,"title":"Suhyun Pak - $('box-0') != event.target != boxCompare[0]","user":{"login":"searchforac","id":14316760,"avatar_url":"https://avatars.githubusercontent.com/u/14316760?v=3","gravatar_id":"","url":"https://api.github.com/users/searchforac","html_url":"https://github.com/searchforac","followers_url":"https://api.github.com/users/searchforac/followers","following_url":"https://api.github.com/users/searchforac/following{/other_user}","gists_url":"https://api.github.com/users/searchforac/gists{/gist_id}","starred_url":"https://api.github.com/users/searchforac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/searchforac/subscriptions","organizations_url":"https://api.github.com/users/searchforac/orgs","repos_url":"https://api.github.com/users/searchforac/repos","events_url":"https://api.github.com/users/searchforac/events{/privacy}","received_events_url":"https://api.github.com/users/searchforac/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"annarankin","id":11503403,"avatar_url":"https://avatars.githubusercontent.com/u/11503403?v=3","gravatar_id":"","url":"https://api.github.com/users/annarankin","html_url":"https://github.com/annarankin","followers_url":"https://api.github.com/users/annarankin/followers","following_url":"https://api.github.com/users/annarankin/following{/other_user}","gists_url":"https://api.github.com/users/annarankin/gists{/gist_id}","starred_url":"https://api.github.com/users/annarankin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/annarankin/subscriptions","organizations_url":"https://api.github.com/users/annarankin/orgs","repos_url":"https://api.github.com/users/annarankin/repos","events_url":"https://api.github.com/users/annarankin/events{/privacy}","received_events_url":"https://api.github.com/users/annarankin/received_events","type":"User","site_admin":false},"milestone":null,"comments":0,"created_at":"2015-11-08T15:31:22Z","updated_at":"2015-11-08T15:31:22Z","closed_at":null,"body":"Hi Anna, I am trying to dry up some of my code and running into a problem trying to empty a div.   I have an event caller that calls a function flipCard0.  flipCard0 pushes $('box-0'), which is a div, into an array boxCompare.  flipCard0 calls another function testForMatch which has a window.timeOut that calls another function flipSlow.  flipSlow tries to empty the the div $('box-0').  My issue is when i try to empty the div using boxCompare[0] i get an error (see attached).  When I use $('box-0') everything is fine and it empties the div.  Is $('box-0') === event.target === boxCompare[0]\r\n\r\n![screen shot 2015-11-08 at 10 29 50 am](https://cloud.githubusercontent.com/assets/14316760/11021063/c2c10448-8603-11e5-9787-44f02f64cd00.png)\r\n\r\n$box0.on('click', flipCard0);\r\n\r\nvar flipCard0 = function(event) {\r\n\tif ($box0.is(':empty') && flipCount < 2) {\r\n\t\tflipCount++;\r\n\t\t$box0.prepend(shuffledArray[0])\r\n\t\tcardCompare.push(shuffledArray[0]);\r\n\t\tboxCompare.push(event.target);\r\n \t\tif (flipCount > 1) {\r\n \t\t\ttestForMatch()\r\n \t\t\r\n \t\t}\r\n\r\n\t} \telse {\r\n\t\t\tconsole.log(\"no dice\")\r\n\t\t}\r\n}\r\n\r\n\r\nvar testForMatch = function(event) {\r\n\tif (cardCompare[0].src === cardCompare[1].src) {\r\n\t\tconsole.log('we got a match');\r\n\t\tmatchCount++\r\n\t\tclearTempArrays()\r\n\t\tflipCount = 0;\r\n\t\tif (matchCount === 6) {\r\n\t\t\tconsole.log('you win')\t\r\n\t\t}\t\t\r\n\r\n\r\n\t} else {\r\n\t\tconsole.log('no match');\r\n\t\tvar timeoutID = window.setTimeout(flipSlow, 1500);\r\n\t\t}\r\n}\r\n\r\nvar flipSlow = function() {\r\n\tconsole.log(event.target)\r\n\t\t\tboxCompare[0].empty();\r\n\t\t\tboxCompare[1].empty();\r\n\t\t\tflipCount = 0;\r\n\t\t\tclearTempArrays();\r\n\t\t}"}}