{"action":"created","issue":{"url":"https://api.github.com/repos/suoyuesmile/full-stack-developer/issues/15","repository_url":"https://api.github.com/repos/suoyuesmile/full-stack-developer","labels_url":"https://api.github.com/repos/suoyuesmile/full-stack-developer/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/suoyuesmile/full-stack-developer/issues/15/comments","events_url":"https://api.github.com/repos/suoyuesmile/full-stack-developer/issues/15/events","html_url":"https://github.com/suoyuesmile/full-stack-developer/issues/15","id":253913086,"number":15,"title":"JavaScript继承设计机制","user":{"login":"suoyuesmile","id":22629276,"avatar_url":"https://avatars1.githubusercontent.com/u/22629276?v=4","gravatar_id":"","url":"https://api.github.com/users/suoyuesmile","html_url":"https://github.com/suoyuesmile","followers_url":"https://api.github.com/users/suoyuesmile/followers","following_url":"https://api.github.com/users/suoyuesmile/following{/other_user}","gists_url":"https://api.github.com/users/suoyuesmile/gists{/gist_id}","starred_url":"https://api.github.com/users/suoyuesmile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suoyuesmile/subscriptions","organizations_url":"https://api.github.com/users/suoyuesmile/orgs","repos_url":"https://api.github.com/users/suoyuesmile/repos","events_url":"https://api.github.com/users/suoyuesmile/events{/privacy}","received_events_url":"https://api.github.com/users/suoyuesmile/received_events","type":"User","site_admin":false},"labels":[{"id":679425323,"url":"https://api.github.com/repos/suoyuesmile/full-stack-developer/labels/js","name":"js","color":"fbca04","default":false},{"id":679426352,"url":"https://api.github.com/repos/suoyuesmile/full-stack-developer/labels/to-do-list","name":"to-do-list","color":"1d76db","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-08-30T08:09:13Z","updated_at":"2017-09-08T03:37:08Z","closed_at":null,"author_association":"OWNER","body":""},"comment":{"url":"https://api.github.com/repos/suoyuesmile/full-stack-developer/issues/comments/327990558","html_url":"https://github.com/suoyuesmile/full-stack-developer/issues/15#issuecomment-327990558","issue_url":"https://api.github.com/repos/suoyuesmile/full-stack-developer/issues/15","id":327990558,"user":{"login":"suoyuesmile","id":22629276,"avatar_url":"https://avatars1.githubusercontent.com/u/22629276?v=4","gravatar_id":"","url":"https://api.github.com/users/suoyuesmile","html_url":"https://github.com/suoyuesmile","followers_url":"https://api.github.com/users/suoyuesmile/followers","following_url":"https://api.github.com/users/suoyuesmile/following{/other_user}","gists_url":"https://api.github.com/users/suoyuesmile/gists{/gist_id}","starred_url":"https://api.github.com/users/suoyuesmile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suoyuesmile/subscriptions","organizations_url":"https://api.github.com/users/suoyuesmile/orgs","repos_url":"https://api.github.com/users/suoyuesmile/repos","events_url":"https://api.github.com/users/suoyuesmile/events{/privacy}","received_events_url":"https://api.github.com/users/suoyuesmile/received_events","type":"User","site_admin":false},"created_at":"2017-09-08T03:37:08Z","updated_at":"2017-09-08T03:37:08Z","author_association":"OWNER","body":"1. 引入new命令并简化类直接使用构造函数\r\n```js\r\nfunction DOG(name) {\r\n this.name = name;\r\n}\r\nvar dog = new DOG('大毛')；\r\nalert(dog.name);\r\n```\r\n2. 构造函数无法共享变量引入prototype属性\r\n- 为构造函数设置属性prototype，这个属性包含一个对象\r\n- 需要共享的属性方法放这个对象中，不需要共享的放构造函数中\r\n- 对象一旦创建自动引用prototype对象的属性和方法，实例的对象一共两种，一种本地，一种引用\r\n```js\r\nfunction DOG(name) {\r\n  this.name = name;\r\n}\r\nDOG.prototype = { species : '猫科'}；\r\nvar dog = new DOG('大毛');\r\nvar dog1 = new DOG('二毛');\r\n\r\nalert(dog.species);\r\nalert(dog1.species);\r\n```\r\n\r\n**所有实例共享一个prototype对象，prototype对象就好像实例对象的原型，而实例对象则好像继承了prototype对象一样**\r\n\r\n"}}
{"actor":{"display_login":"suoyuesmile"}}