{"action":"opened","issue":{"url":"https://api.github.com/repos/Wscats/Good-text-Share/issues/56","repository_url":"https://api.github.com/repos/Wscats/Good-text-Share","labels_url":"https://api.github.com/repos/Wscats/Good-text-Share/issues/56/labels{/name}","comments_url":"https://api.github.com/repos/Wscats/Good-text-Share/issues/56/comments","events_url":"https://api.github.com/repos/Wscats/Good-text-Share/issues/56/events","html_url":"https://github.com/Wscats/Good-text-Share/issues/56","id":179019813,"number":56,"title":"Javascript中的apply和call","user":{"login":"Wscats","id":17243165,"avatar_url":"https://avatars.githubusercontent.com/u/17243165?v=3","gravatar_id":"","url":"https://api.github.com/users/Wscats","html_url":"https://github.com/Wscats","followers_url":"https://api.github.com/users/Wscats/followers","following_url":"https://api.github.com/users/Wscats/following{/other_user}","gists_url":"https://api.github.com/users/Wscats/gists{/gist_id}","starred_url":"https://api.github.com/users/Wscats/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wscats/subscriptions","organizations_url":"https://api.github.com/users/Wscats/orgs","repos_url":"https://api.github.com/users/Wscats/repos","events_url":"https://api.github.com/users/Wscats/events{/privacy}","received_events_url":"https://api.github.com/users/Wscats/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-24T08:51:46Z","updated_at":"2016-09-24T08:51:46Z","closed_at":null,"body":"call\r\n```\r\nfunction animal(a, b) {\r\n\t\t\tthis.type = 'animal'\r\n\t\t\tthis.behavior = function(){\r\n\t\t\t\tconsole.log(this.type+\" is running\")\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfunction cat(a, b) {\r\n\t\t\tthis.name = 'wsscat'\r\n\t\t\t//这里call的意思就是把animal的方法应用到cat这个对象身上\r\n\t\t\t//所以cat就继承了animal的方法\r\n\t\t\tanimal.call(this);\r\n\t\t}\r\n\r\n\t\tconsole.log(new cat())\r\n```\r\n![qq 20160924165406](https://cloud.githubusercontent.com/assets/17243165/18807350/22b89724-8277-11e6-9632-1434325ac531.png)\r\n"}}
{"actor":{"display_login":"Wscats"}}