{"action":"opened","issue":{"url":"https://api.github.com/repos/ruanyf/es6tutorial/issues/623","repository_url":"https://api.github.com/repos/ruanyf/es6tutorial","labels_url":"https://api.github.com/repos/ruanyf/es6tutorial/issues/623/labels{/name}","comments_url":"https://api.github.com/repos/ruanyf/es6tutorial/issues/623/comments","events_url":"https://api.github.com/repos/ruanyf/es6tutorial/issues/623/events","html_url":"https://github.com/ruanyf/es6tutorial/issues/623","id":303779337,"number":623,"title":"\"Set和Map数据结构\"一章中一处解释有疑问","user":{"login":"Plortinus","id":20693993,"avatar_url":"https://avatars3.githubusercontent.com/u/20693993?v=4","gravatar_id":"","url":"https://api.github.com/users/Plortinus","html_url":"https://github.com/Plortinus","followers_url":"https://api.github.com/users/Plortinus/followers","following_url":"https://api.github.com/users/Plortinus/following{/other_user}","gists_url":"https://api.github.com/users/Plortinus/gists{/gist_id}","starred_url":"https://api.github.com/users/Plortinus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Plortinus/subscriptions","organizations_url":"https://api.github.com/users/Plortinus/orgs","repos_url":"https://api.github.com/users/Plortinus/repos","events_url":"https://api.github.com/users/Plortinus/events{/privacy}","received_events_url":"https://api.github.com/users/Plortinus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-09T09:39:16Z","updated_at":"2018-03-09T09:39:16Z","closed_at":null,"author_association":"NONE","body":"Set 基本用法\r\n```js\r\n// 例三\r\nfunction divs () {\r\n  return [...document.querySelectorAll('div')];\r\n}\r\n\r\nconst set = new Set(divs());\r\nset.size // 56\r\n\r\n// 类似于\r\ndivs().forEach(div => set.add(div));\r\nset.size // 56\r\n```\r\n`上面代码中，例一和例二都是Set函数接受数组作为参数，例三是接受类似数组的对象作为参数。`\r\n\r\n例子三中，Set函数接受的参数`divs()`其实还是一个数组，不是类似数组，它在前面已经通过扩展符变成数组了，所以这里这样解释有问题。"}}
{"actor":{"display_login":"Plortinus"}}