{"action":"closed","issue":{"url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/issues/8970","repository_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp","labels_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/issues/8970/labels{/name}","comments_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/issues/8970/comments","events_url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/issues/8970/events","html_url":"https://github.com/FreeCodeCamp/FreeCodeCamp/issues/8970","id":158540408,"number":8970,"title":"I am doing what is required but it is mot letting me pass.","user":{"login":"pragya68","id":9749234,"avatar_url":"https://avatars.githubusercontent.com/u/9749234?v=3","gravatar_id":"","url":"https://api.github.com/users/pragya68","html_url":"https://github.com/pragya68","followers_url":"https://api.github.com/users/pragya68/followers","following_url":"https://api.github.com/users/pragya68/following{/other_user}","gists_url":"https://api.github.com/users/pragya68/gists{/gist_id}","starred_url":"https://api.github.com/users/pragya68/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pragya68/subscriptions","organizations_url":"https://api.github.com/users/pragya68/orgs","repos_url":"https://api.github.com/users/pragya68/repos","events_url":"https://api.github.com/users/pragya68/events{/privacy}","received_events_url":"https://api.github.com/users/pragya68/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/labels/confirmed","name":"confirmed","color":"ededed"},{"url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/labels/first-timers-only","name":"first-timers-only","color":"207de5"},{"url":"https://api.github.com/repos/FreeCodeCamp/FreeCodeCamp/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2016-06-05T06:31:28Z","updated_at":"2016-06-09T04:46:59Z","closed_at":"2016-06-09T04:46:59Z","body":"Challenge [Record Collection](https://www.freecodecamp.com/challenges/record-collection#?solution=%0A%2F%2F%20Setup%0Avar%20collection%20%3D%20%7B%0A%20%20%20%202548%3A%20%7B%0A%20%20%20%20%20%20album%3A%20%22Slippery%20When%20Wet%22%2C%0A%20%20%20%20%20%20artist%3A%20%22Bon%20Jovi%22%2C%0A%20%20%20%20%20%20tracks%3A%20%5B%20%0A%20%20%20%20%20%20%20%20%22Let%20It%20Rock%22%2C%20%0A%20%20%20%20%20%20%20%20%22You%20Give%20Love%20a%20Bad%20Name%22%20%0A%20%20%20%20%20%20%5D%0A%20%20%20%20%7D%2C%0A%20%20%20%202468%3A%20%7B%0A%20%20%20%20%20%20album%3A%20%221999%22%2C%0A%20%20%20%20%20%20artist%3A%20%22Prince%22%2C%0A%20%20%20%20%20%20tracks%3A%20%5B%20%0A%20%20%20%20%20%20%20%20%221999%22%2C%20%0A%20%20%20%20%20%20%20%20%22Little%20Red%20Corvette%22%20%0A%20%20%20%20%20%20%5D%0A%20%20%20%20%7D%2C%0A%20%20%20%201245%3A%20%7B%0A%20%20%20%20%20%20artist%3A%20%22Robert%20Palmer%22%2C%0A%20%20%20%20%20%20tracks%3A%20%5B%20%5D%0A%20%20%20%20%7D%2C%0A%20%20%20%205439%3A%20%7B%0A%20%20%20%20%20%20album%3A%20%22ABBA%20Gold%22%0A%20%20%20%20%7D%0A%7D%3B%0A%2F%2F%20Keep%20a%20copy%20of%20the%20collection%20for%20tests%0Avar%20collectionCopy%20%3D%20JSON.parse(JSON.stringify(collection))%3B%0A%0A%2F%2F%20Only%20change%20code%20below%20this%20line%0Afunction%20updateRecords(id%2C%20prop%2C%20value)%20%7B%0A%20%20if(%20value%20!%3D%3D%20%22%22)%7B%0A%20%20%20%20if(prop!%3D%3D%22tracks%22)%7B%0A%20%20%20%20%20%20collection%5Bid%5D%5Bprop%5D%3Dvalue%3B%0A%20%20%20%20%7D%0A%20%20%20%20else%20if(%20prop%20%3D%3D%3D%22tracks%22)%7B%0A%20%20%20%20%20%20collection%5Bid%5D%5Bprop%5D.push(value)%3B%0A%20%20%20%20%7D%0A%20%20%7D%0A%20%20else%0A%20%20%20%20delete%20collection%5Bid%5D%5Bprop%5D%3B%0A%0A%20%20return%20collection%3B%0A%7D%0A%0A%2F%2F%20Alter%20values%20below%20to%20test%20your%20code%0AupdateRecords(5439%2C%20%22artist%22%2C%20%22ABBA%22)%3B%0A%0A) has an issue.\r\nUser Agent is: <code>Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 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\n// Setup\r\nvar collection = {\r\n    2548: {\r\n      album: \"Slippery When Wet\",\r\n      artist: \"Bon Jovi\",\r\n      tracks: [ \r\n        \"Let It Rock\", \r\n        \"You Give Love a Bad Name\" \r\n      ]\r\n    },\r\n    2468: {\r\n      album: \"1999\",\r\n      artist: \"Prince\",\r\n      tracks: [ \r\n        \"1999\", \r\n        \"Little Red Corvette\" \r\n      ]\r\n    },\r\n    1245: {\r\n      artist: \"Robert Palmer\",\r\n      tracks: [ ]\r\n    },\r\n    5439: {\r\n      album: \"ABBA Gold\"\r\n    }\r\n};\r\n// Keep a copy of the collection for tests\r\nvar collectionCopy = JSON.parse(JSON.stringify(collection));\r\n\r\n// Only change code below this line\r\nfunction updateRecords(id, prop, value) {\r\n  if( value !== \"\"){\r\n    if(prop!==\"tracks\"){\r\n      collection[id][prop]=value;\r\n    }\r\n    else if( prop ===\"tracks\"){\r\n      collection[id][prop].push(value);\r\n    }\r\n  }\r\n  else\r\n    delete collection[id][prop];\r\n\r\n  return collection;\r\n}\r\n\r\n// Alter values below to test your code\r\nupdateRecords(5439, \"artist\", \"ABBA\");\r\n\r\n\r\n```\r\n\r\n"}}
{"actor":{"display_login":"erictleung"}}