{"action":"opened","issue":{"url":"https://api.github.com/repos/tian-miku/javascript/issues/20","repository_url":"https://api.github.com/repos/tian-miku/javascript","labels_url":"https://api.github.com/repos/tian-miku/javascript/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/tian-miku/javascript/issues/20/comments","events_url":"https://api.github.com/repos/tian-miku/javascript/issues/20/events","html_url":"https://github.com/tian-miku/javascript/issues/20","id":307482503,"number":20,"title":"惰性函数","user":{"login":"tian-miku","id":22806915,"avatar_url":"https://avatars3.githubusercontent.com/u/22806915?v=4","gravatar_id":"","url":"https://api.github.com/users/tian-miku","html_url":"https://github.com/tian-miku","followers_url":"https://api.github.com/users/tian-miku/followers","following_url":"https://api.github.com/users/tian-miku/following{/other_user}","gists_url":"https://api.github.com/users/tian-miku/gists{/gist_id}","starred_url":"https://api.github.com/users/tian-miku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tian-miku/subscriptions","organizations_url":"https://api.github.com/users/tian-miku/orgs","repos_url":"https://api.github.com/users/tian-miku/repos","events_url":"https://api.github.com/users/tian-miku/events{/privacy}","received_events_url":"https://api.github.com/users/tian-miku/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-22T02:20:50Z","updated_at":"2018-03-22T02:20:50Z","closed_at":null,"author_association":"OWNER","body":"我们现在需要写一个 foo 函数，这个函数返回首次调用时的 Date 对象，注意是首次\r\n\r\n惰性函数就是解决每次都要进行判断的这个问题，解决原理很简单，重写函数。\r\n\r\n```\r\nlet foo = function () {\r\nlet t = new Date();\r\nfoo = function() {\r\nreturn t;\r\n}\r\nreturn foo();\r\n}\r\n```"}}
{"actor":{"display_login":"tian-miku"}}