{"action":"created","comment":{"url":"https://api.github.com/repos/hand12/TypeScriptPractice/pulls/comments/120286207","pull_request_review_id":42233666,"id":120286207,"diff_hunk":"@@ -0,0 +1,5 @@\n+const age: number = 32\n+const birthday: string = \"1985-05-01\"\n+const isAlive: boolean = false\n+const hobby: string[] = [\"fishing\", \"skiing\"]\n+const CantThinkOfGoodName: [number, boolean] = [1, true]","path":"exercise1/question1.ts","position":5,"original_position":5,"commit_id":"051671b5ddd10ca8c86d492dace33f98710733dc","original_commit_id":"1ad67532edd7fc410ec1e4472870ef483e28ace5","user":{"login":"hand12","id":15228193,"avatar_url":"https://avatars0.githubusercontent.com/u/15228193?v=3","gravatar_id":"","url":"https://api.github.com/users/hand12","html_url":"https://github.com/hand12","followers_url":"https://api.github.com/users/hand12/followers","following_url":"https://api.github.com/users/hand12/following{/other_user}","gists_url":"https://api.github.com/users/hand12/gists{/gist_id}","starred_url":"https://api.github.com/users/hand12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hand12/subscriptions","organizations_url":"https://api.github.com/users/hand12/orgs","repos_url":"https://api.github.com/users/hand12/repos","events_url":"https://api.github.com/users/hand12/events{/privacy}","received_events_url":"https://api.github.com/users/hand12/received_events","type":"User","site_admin":false},"body":"documentにしっかり書いてありました。","created_at":"2017-06-06T07:52:07Z","updated_at":"2017-06-06T07:55:16Z","html_url":"https://github.com/hand12/TypeScriptPractice/pull/2#discussion_r120286207","pull_request_url":"https://api.github.com/repos/hand12/TypeScriptPractice/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/hand12/TypeScriptPractice/pulls/comments/120286207"},"html":{"href":"https://github.com/hand12/TypeScriptPractice/pull/2#discussion_r120286207"},"pull_request":{"href":"https://api.github.com/repos/hand12/TypeScriptPractice/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/hand12/TypeScriptPractice/pulls/2","id":124090354,"html_url":"https://github.com/hand12/TypeScriptPractice/pull/2","diff_url":"https://github.com/hand12/TypeScriptPractice/pull/2.diff","patch_url":"https://github.com/hand12/TypeScriptPractice/pull/2.patch","issue_url":"https://api.github.com/repos/hand12/TypeScriptPractice/issues/2","number":2,"state":"open","locked":false,"title":"Exercise1. TyoeScript型エクササイズ","user":{"login":"hand12","id":15228193,"avatar_url":"https://avatars0.githubusercontent.com/u/15228193?v=3","gravatar_id":"","url":"https://api.github.com/users/hand12","html_url":"https://github.com/hand12","followers_url":"https://api.github.com/users/hand12/followers","following_url":"https://api.github.com/users/hand12/following{/other_user}","gists_url":"https://api.github.com/users/hand12/gists{/gist_id}","starred_url":"https://api.github.com/users/hand12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hand12/subscriptions","organizations_url":"https://api.github.com/users/hand12/orgs","repos_url":"https://api.github.com/users/hand12/repos","events_url":"https://api.github.com/users/hand12/events{/privacy}","received_events_url":"https://api.github.com/users/hand12/received_events","type":"User","site_admin":false},"body":"# WHY\r\nTypeScriptの型になれる。\r\n基本的にany型は使わない。\r\n\r\n.\r\n\r\n    const age = 32\r\n    const birthday = \"1985-05-01\"\r\n    const isAlive = false\r\n    const hobby = [\"fishing\", \"skiing\"]\r\n    const CantThinkOfGoodName = [1, true]\r\n    \r\n    age, birthday, isAlive, hobby, CantThinkOfGoodNameに適切な型を付けましょう。\r\n\r\n2.\r\n\r\n    function eat(){\r\n      console.log(\"mogumogu\")\r\n    }\r\n    \r\n    eat関数の返り値の型を適切に設定しましょう。\r\n\r\n3.\r\n\r\n    null, undefined, NaNについて調べてみましょう。\r\n\r\n4.\r\n\r\n    function confessSecret(person): void {\r\n      const confession: string = person.secret || \"Im a boring person.\"\r\n      console.log(confession)\r\n    }\r\n\r\n引数`person`に適切な型を付けましょう。\r\n\r\n5.\r\n\r\n    const giveMeYourLove = (money) => Array(money).fill(\"love\")\r\n    \r\n    giveMeYourLoveの型をinterfaceを使って定義してみましょう。\r\n\r\n6.\r\n\r\n    interface Religion {\r\n      name: string\r\n      founder: string\r\n      sutra: string[]\r\n    }\r\n    \r\n    Religion型をimplementしたReligionクラスを書いてみましょう。(コンストラクタも実装しましょう。)\r\n\r\n7.\r\n\r\n    interface Hero {\r\n      name: string\r\n    }\r\n    \r\n    interface GuitarHero {\r\n      name: string\r\n      guitar: string\r\n    }\r\n    \r\n    Hero型を拡張してGuitarHero型を定義してみましょう。\r\n\r\n11.\r\n\r\n    function duplicate<T>(arg: T): T[] {\r\n      return [arg, arg]\r\n    }\r\n    \r\n    duplicate<number>の引数の型、返り値の型を考えましょう。\r\n\r\n12.\r\n\r\n    7.をextendsを使わないで書いてみましょう。\r\n\r\n13.\r\n\r\n    const numberOrString = [1, \"2\", 3, \"4\", 5 ]\r\n    \r\n    numberOrStringに適切な型をつけてみましょう。\r\n\r\n14.\r\n\r\n    type GuitarHero = {\r\n      name: string\r\n      guitar: string\r\n    }\r\n    \r\n    type MarvelHero = {\r\n      name: string\r\n      ability: string\r\n    }","created_at":"2017-06-06T00:59:07Z","updated_at":"2017-06-06T07:55:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1a0250d8638560741c41bbcd93b5b8770bc83cba","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/hand12/TypeScriptPractice/pulls/2/commits","review_comments_url":"https://api.github.com/repos/hand12/TypeScriptPractice/pulls/2/comments","review_comment_url":"https://api.github.com/repos/hand12/TypeScriptPractice/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hand12/TypeScriptPractice/issues/2/comments","statuses_url":"https://api.github.com/repos/hand12/TypeScriptPractice/statuses/051671b5ddd10ca8c86d492dace33f98710733dc","head":{"label":"hand12:exercise1","ref":"exercise1","sha":"051671b5ddd10ca8c86d492dace33f98710733dc","user":{"login":"hand12","id":15228193,"avatar_url":"https://avatars0.githubusercontent.com/u/15228193?v=3","gravatar_id":"","url":"https://api.github.com/users/hand12","html_url":"https://github.com/hand12","followers_url":"https://api.github.com/users/hand12/followers","following_url":"https://api.github.com/users/hand12/following{/other_user}","gists_url":"https://api.github.com/users/hand12/gists{/gist_id}","starred_url":"https://api.github.com/users/hand12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hand12/subscriptions","organizations_url":"https://api.github.com/users/hand12/orgs","repos_url":"https://api.github.com/users/hand12/repos","events_url":"https://api.github.com/users/hand12/events{/privacy}","received_events_url":"https://api.github.com/users/hand12/received_events","type":"User","site_admin":false},"repo":{"id":93388761,"name":"TypeScriptPractice","full_name":"hand12/TypeScriptPractice","owner":{"login":"hand12","id":15228193,"avatar_url":"https://avatars0.githubusercontent.com/u/15228193?v=3","gravatar_id":"","url":"https://api.github.com/users/hand12","html_url":"https://github.com/hand12","followers_url":"https://api.github.com/users/hand12/followers","following_url":"https://api.github.com/users/hand12/following{/other_user}","gists_url":"https://api.github.com/users/hand12/gists{/gist_id}","starred_url":"https://api.github.com/users/hand12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hand12/subscriptions","organizations_url":"https://api.github.com/users/hand12/orgs","repos_url":"https://api.github.com/users/hand12/repos","events_url":"https://api.github.com/users/hand12/events{/privacy}","received_events_url":"https://api.github.com/users/hand12/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hand12/TypeScriptPractice","description":null,"fork":false,"url":"https://api.github.com/repos/hand12/TypeScriptPractice","forks_url":"https://api.github.com/repos/hand12/TypeScriptPractice/forks","keys_url":"https://api.github.com/repos/hand12/TypeScriptPractice/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hand12/TypeScriptPractice/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hand12/TypeScriptPractice/teams","hooks_url":"https://api.github.com/repos/hand12/TypeScriptPractice/hooks","issue_events_url":"https://api.github.com/repos/hand12/TypeScriptPractice/issues/events{/number}","events_url":"https://api.github.com/repos/hand12/TypeScriptPractice/events","assignees_url":"https://api.github.com/repos/hand12/TypeScriptPractice/assignees{/user}","branches_url":"https://api.github.com/repos/hand12/TypeScriptPractice/branches{/branch}","tags_url":"https://api.github.com/repos/hand12/TypeScriptPractice/tags","blobs_url":"https://api.github.com/repos/hand12/TypeScriptPractice/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hand12/TypeScriptPractice/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hand12/TypeScriptPractice/git/refs{/sha}","trees_url":"https://api.github.com/repos/hand12/TypeScriptPractice/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hand12/TypeScriptPractice/statuses/{sha}","languages_url":"https://api.github.com/repos/hand12/TypeScriptPractice/languages","stargazers_url":"https://api.github.com/repos/hand12/TypeScriptPractice/stargazers","contributors_url":"https://api.github.com/repos/hand12/TypeScriptPractice/contributors","subscribers_url":"https://api.github.com/repos/hand12/TypeScriptPractice/subscribers","subscription_url":"https://api.github.com/repos/hand12/TypeScriptPractice/subscription","commits_url":"https://api.github.com/repos/hand12/TypeScriptPractice/commits{/sha}","git_commits_url":"https://api.github.com/repos/hand12/TypeScriptPractice/git/commits{/sha}","comments_url":"https://api.github.com/repos/hand12/TypeScriptPractice/comments{/number}","issue_comment_url":"https://api.github.com/repos/hand12/TypeScriptPractice/issues/comments{/number}","contents_url":"https://api.github.com/repos/hand12/TypeScriptPractice/contents/{+path}","compare_url":"https://api.github.com/repos/hand12/TypeScriptPractice/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hand12/TypeScriptPractice/merges","archive_url":"https://api.github.com/repos/hand12/TypeScriptPractice/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hand12/TypeScriptPractice/downloads","issues_url":"https://api.github.com/repos/hand12/TypeScriptPractice/issues{/number}","pulls_url":"https://api.github.com/repos/hand12/TypeScriptPractice/pulls{/number}","milestones_url":"https://api.github.com/repos/hand12/TypeScriptPractice/milestones{/number}","notifications_url":"https://api.github.com/repos/hand12/TypeScriptPractice/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hand12/TypeScriptPractice/labels{/name}","releases_url":"https://api.github.com/repos/hand12/TypeScriptPractice/releases{/id}","deployments_url":"https://api.github.com/repos/hand12/TypeScriptPractice/deployments","created_at":"2017-06-05T09:39:31Z","updated_at":"2017-06-05T10:20:46Z","pushed_at":"2017-06-06T07:54:15Z","git_url":"git://github.com/hand12/TypeScriptPractice.git","ssh_url":"git@github.com:hand12/TypeScriptPractice.git","clone_url":"https://github.com/hand12/TypeScriptPractice.git","svn_url":"https://github.com/hand12/TypeScriptPractice","homepage":null,"size":6,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"base":{"label":"hand12:master","ref":"master","sha":"e95c383a8b150ca7499aaabfa9f7c5fc6f3fb98f","user":{"login":"hand12","id":15228193,"avatar_url":"https://avatars0.githubusercontent.com/u/15228193?v=3","gravatar_id":"","url":"https://api.github.com/users/hand12","html_url":"https://github.com/hand12","followers_url":"https://api.github.com/users/hand12/followers","following_url":"https://api.github.com/users/hand12/following{/other_user}","gists_url":"https://api.github.com/users/hand12/gists{/gist_id}","starred_url":"https://api.github.com/users/hand12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hand12/subscriptions","organizations_url":"https://api.github.com/users/hand12/orgs","repos_url":"https://api.github.com/users/hand12/repos","events_url":"https://api.github.com/users/hand12/events{/privacy}","received_events_url":"https://api.github.com/users/hand12/received_events","type":"User","site_admin":false},"repo":{"id":93388761,"name":"TypeScriptPractice","full_name":"hand12/TypeScriptPractice","owner":{"login":"hand12","id":15228193,"avatar_url":"https://avatars0.githubusercontent.com/u/15228193?v=3","gravatar_id":"","url":"https://api.github.com/users/hand12","html_url":"https://github.com/hand12","followers_url":"https://api.github.com/users/hand12/followers","following_url":"https://api.github.com/users/hand12/following{/other_user}","gists_url":"https://api.github.com/users/hand12/gists{/gist_id}","starred_url":"https://api.github.com/users/hand12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hand12/subscriptions","organizations_url":"https://api.github.com/users/hand12/orgs","repos_url":"https://api.github.com/users/hand12/repos","events_url":"https://api.github.com/users/hand12/events{/privacy}","received_events_url":"https://api.github.com/users/hand12/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hand12/TypeScriptPractice","description":null,"fork":false,"url":"https://api.github.com/repos/hand12/TypeScriptPractice","forks_url":"https://api.github.com/repos/hand12/TypeScriptPractice/forks","keys_url":"https://api.github.com/repos/hand12/TypeScriptPractice/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hand12/TypeScriptPractice/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hand12/TypeScriptPractice/teams","hooks_url":"https://api.github.com/repos/hand12/TypeScriptPractice/hooks","issue_events_url":"https://api.github.com/repos/hand12/TypeScriptPractice/issues/events{/number}","events_url":"https://api.github.com/repos/hand12/TypeScriptPractice/events","assignees_url":"https://api.github.com/repos/hand12/TypeScriptPractice/assignees{/user}","branches_url":"https://api.github.com/repos/hand12/TypeScriptPractice/branches{/branch}","tags_url":"https://api.github.com/repos/hand12/TypeScriptPractice/tags","blobs_url":"https://api.github.com/repos/hand12/TypeScriptPractice/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hand12/TypeScriptPractice/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hand12/TypeScriptPractice/git/refs{/sha}","trees_url":"https://api.github.com/repos/hand12/TypeScriptPractice/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hand12/TypeScriptPractice/statuses/{sha}","languages_url":"https://api.github.com/repos/hand12/TypeScriptPractice/languages","stargazers_url":"https://api.github.com/repos/hand12/TypeScriptPractice/stargazers","contributors_url":"https://api.github.com/repos/hand12/TypeScriptPractice/contributors","subscribers_url":"https://api.github.com/repos/hand12/TypeScriptPractice/subscribers","subscription_url":"https://api.github.com/repos/hand12/TypeScriptPractice/subscription","commits_url":"https://api.github.com/repos/hand12/TypeScriptPractice/commits{/sha}","git_commits_url":"https://api.github.com/repos/hand12/TypeScriptPractice/git/commits{/sha}","comments_url":"https://api.github.com/repos/hand12/TypeScriptPractice/comments{/number}","issue_comment_url":"https://api.github.com/repos/hand12/TypeScriptPractice/issues/comments{/number}","contents_url":"https://api.github.com/repos/hand12/TypeScriptPractice/contents/{+path}","compare_url":"https://api.github.com/repos/hand12/TypeScriptPractice/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hand12/TypeScriptPractice/merges","archive_url":"https://api.github.com/repos/hand12/TypeScriptPractice/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hand12/TypeScriptPractice/downloads","issues_url":"https://api.github.com/repos/hand12/TypeScriptPractice/issues{/number}","pulls_url":"https://api.github.com/repos/hand12/TypeScriptPractice/pulls{/number}","milestones_url":"https://api.github.com/repos/hand12/TypeScriptPractice/milestones{/number}","notifications_url":"https://api.github.com/repos/hand12/TypeScriptPractice/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hand12/TypeScriptPractice/labels{/name}","releases_url":"https://api.github.com/repos/hand12/TypeScriptPractice/releases{/id}","deployments_url":"https://api.github.com/repos/hand12/TypeScriptPractice/deployments","created_at":"2017-06-05T09:39:31Z","updated_at":"2017-06-05T10:20:46Z","pushed_at":"2017-06-06T07:54:15Z","git_url":"git://github.com/hand12/TypeScriptPractice.git","ssh_url":"git@github.com:hand12/TypeScriptPractice.git","clone_url":"https://github.com/hand12/TypeScriptPractice.git","svn_url":"https://github.com/hand12/TypeScriptPractice","homepage":null,"size":6,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/hand12/TypeScriptPractice/pulls/2"},"html":{"href":"https://github.com/hand12/TypeScriptPractice/pull/2"},"issue":{"href":"https://api.github.com/repos/hand12/TypeScriptPractice/issues/2"},"comments":{"href":"https://api.github.com/repos/hand12/TypeScriptPractice/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/hand12/TypeScriptPractice/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/hand12/TypeScriptPractice/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hand12/TypeScriptPractice/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/hand12/TypeScriptPractice/statuses/051671b5ddd10ca8c86d492dace33f98710733dc"}}}}
{"actor":{"display_login":"hand12"}}