{"action":"opened","issue":{"url":"https://api.github.com/repos/urain39/stuff/issues/2","repository_url":"https://api.github.com/repos/urain39/stuff","labels_url":"https://api.github.com/repos/urain39/stuff/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/urain39/stuff/issues/2/comments","events_url":"https://api.github.com/repos/urain39/stuff/issues/2/events","html_url":"https://github.com/urain39/stuff/issues/2","id":407290053,"node_id":"MDU6SXNzdWU0MDcyOTAwNTM=","number":2,"title":"回调的作用域问题","user":{"login":"uzilla","id":30332138,"node_id":"MDQ6VXNlcjMwMzMyMTM4","avatar_url":"https://avatars0.githubusercontent.com/u/30332138?v=4","gravatar_id":"","url":"https://api.github.com/users/uzilla","html_url":"https://github.com/uzilla","followers_url":"https://api.github.com/users/uzilla/followers","following_url":"https://api.github.com/users/uzilla/following{/other_user}","gists_url":"https://api.github.com/users/uzilla/gists{/gist_id}","starred_url":"https://api.github.com/users/uzilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uzilla/subscriptions","organizations_url":"https://api.github.com/users/uzilla/orgs","repos_url":"https://api.github.com/users/uzilla/repos","events_url":"https://api.github.com/users/uzilla/events{/privacy}","received_events_url":"https://api.github.com/users/uzilla/received_events","type":"User","site_admin":false},"labels":[{"id":1223024031,"node_id":"MDU6TGFiZWwxMjIzMDI0MDMx","url":"https://api.github.com/repos/urain39/stuff/labels/C","name":"C","color":"f0f0f0","default":false},{"id":1223022035,"node_id":"MDU6TGFiZWwxMjIzMDIyMDM1","url":"https://api.github.com/repos/urain39/stuff/labels/JavaScript","name":"JavaScript","color":"ffee88","default":false},{"id":1223023530,"node_id":"MDU6TGFiZWwxMjIzMDIzNTMw","url":"https://api.github.com/repos/urain39/stuff/labels/Python","name":"Python","color":"27ea27","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-02-06T15:29:33Z","updated_at":"2019-02-06T15:29:33Z","closed_at":null,"author_association":"COLLABORATOR","body":"回调函数的作用域取决于声明时的作用域，而不是调用它时的作用域。\r\n换言之，**函数的作用域在函数声明时就已经确定了**。\r\n\r\n如：\r\n```js\r\nfunction f() {\r\n  return x;\r\n}\r\n\r\nfunction f2(callback) {\r\n  var x = 0;\r\n  callback();\r\n}\r\n\r\nf2(f);  // ReferenceError: x is not defined\r\n```"}}
{"actor":{"display_login":"uzilla"}}