{"action":"opened","issue":{"url":"https://api.github.com/repos/fac-14/CGKO_API/issues/34","repository_url":"https://api.github.com/repos/fac-14/CGKO_API","labels_url":"https://api.github.com/repos/fac-14/CGKO_API/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/fac-14/CGKO_API/issues/34/comments","events_url":"https://api.github.com/repos/fac-14/CGKO_API/issues/34/events","html_url":"https://github.com/fac-14/CGKO_API/issues/34","id":343044140,"node_id":"MDU6SXNzdWUzNDMwNDQxNDA=","number":34,"title":"Need for IIFFE?","user":{"login":"GiuliaTeggi","id":30217557,"node_id":"MDQ6VXNlcjMwMjE3NTU3","avatar_url":"https://avatars3.githubusercontent.com/u/30217557?v=4","gravatar_id":"","url":"https://api.github.com/users/GiuliaTeggi","html_url":"https://github.com/GiuliaTeggi","followers_url":"https://api.github.com/users/GiuliaTeggi/followers","following_url":"https://api.github.com/users/GiuliaTeggi/following{/other_user}","gists_url":"https://api.github.com/users/GiuliaTeggi/gists{/gist_id}","starred_url":"https://api.github.com/users/GiuliaTeggi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GiuliaTeggi/subscriptions","organizations_url":"https://api.github.com/users/GiuliaTeggi/orgs","repos_url":"https://api.github.com/users/GiuliaTeggi/repos","events_url":"https://api.github.com/users/GiuliaTeggi/events{/privacy}","received_events_url":"https://api.github.com/users/GiuliaTeggi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-20T09:51:06Z","updated_at":"2018-07-20T09:51:06Z","closed_at":null,"author_association":"NONE","body":"I'd just like to point out something about IIFEs, given that you wrapped all of your functions inside one :relaxed: \r\n\r\nImmediately invoked function expressiosns are great to execute a function immediately after invoking it and to avoid polluting the global namespace - since all variable declared inside the IIFE are not accessible from the outside. \r\n\r\nIn your case though, all the functions depend on event listeners (no function is called immediately as the javascript file is read) and there are no other variables or functions outside of the IIFE -\r\n which could have changed the values of the variables you have inside of it. \r\n\r\nBecause of these reasons an IIFE wasn't necessary in your case - it's good to practice using them, given that you've just learnt about closures, but just make sure to understand which use cases are best suited to use them. :wink: "}}
{"actor":{"display_login":"GiuliaTeggi"}}