{"action":"opened","issue":{"url":"https://api.github.com/repos/itkasumy/Blog/issues/17","repository_url":"https://api.github.com/repos/itkasumy/Blog","labels_url":"https://api.github.com/repos/itkasumy/Blog/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/itkasumy/Blog/issues/17/comments","events_url":"https://api.github.com/repos/itkasumy/Blog/issues/17/events","html_url":"https://github.com/itkasumy/Blog/issues/17","id":304771270,"number":17,"title":"ES6系列之属性的简洁表示法","user":{"login":"itkasumy","id":24458297,"avatar_url":"https://avatars0.githubusercontent.com/u/24458297?v=4","gravatar_id":"","url":"https://api.github.com/users/itkasumy","html_url":"https://github.com/itkasumy","followers_url":"https://api.github.com/users/itkasumy/followers","following_url":"https://api.github.com/users/itkasumy/following{/other_user}","gists_url":"https://api.github.com/users/itkasumy/gists{/gist_id}","starred_url":"https://api.github.com/users/itkasumy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/itkasumy/subscriptions","organizations_url":"https://api.github.com/users/itkasumy/orgs","repos_url":"https://api.github.com/users/itkasumy/repos","events_url":"https://api.github.com/users/itkasumy/events{/privacy}","received_events_url":"https://api.github.com/users/itkasumy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-13T13:47:16Z","updated_at":"2018-03-13T13:47:16Z","closed_at":null,"author_association":"OWNER","body":"ES6允许直接写入变量和函数，作为对象的属性和方法。这样的书写更加简洁。\r\n\r\n```js\r\nfunction f( x, y ) {\r\n  return { x, y };\r\n}\r\n// 等同于\r\nfunction f( x, y ) {\r\n  return { x: x, y: y };\r\n}\r\n```\r\n\r\n示例：\r\n\r\n```js\r\nvar Person = {\r\n            name: '张三',\r\n            birth:'1990-01-01',\r\n            // 等同于hello: function ()...\r\n            hello() { document.write('我的名字是', this.name); }\r\n          };\r\n     Person.hello();\r\n```\r\n\r\n这种写法用于函数的返回值，将会非常方便。\r\n\r\n```js\r\nfunction getPoint() {\r\n  var x = 1;\r\n  var y = 10;\r\n  return {x, y};\r\n}\r\ngetPoint()   // {x:1, y:10}\r\n```"}}
{"actor":{"display_login":"itkasumy"}}