{"action":"created","comment":{"url":"https://api.github.com/repos/da2k/curso-javascript-ninja/pulls/comments/38819330","id":38819330,"diff_hunk":"@@ -47,30 +52,53 @@ propriedades:\n - Se o parâmetro não for passado, a função deve retornar o objeto com todos\n os livros.\n */\n-// ?\n+function book(livro){\n+\tlivros = { \n+\t\t'Pequeno Principe': {\n+\t\t quantidadePaginas: 501,\n+\t\t autor: 'Jose Silva', \n+\t\t editora: 'Novatec'\n+\t\t},\n+\t\t\n+\t\t'Mad Max': {\n+\t\t quantidadePaginas: 301,\n+\t\t autor: 'Jorge',\n+\t\t editora: 'Abril'\n+\t\t},\n+\t\t'Tropo de Elite': {\n+\t\t quantidadePaginas: 402,\n+\t\t autor: 'Cezar Oliveira',\n+\t\t editora: 'Globo'\n+\t\t}\n+\t};\n+\t\treturn livro === undefined ? livros : livros[livro];\n+};\n \n /*\n Usando a função criada acima, imprima o objeto com todos os livros.\n */\n-// ?\n+book();\n \n /*\n Ainda com a função acima, imprima a quantidade de páginas de um livro qualquer,\n usando a frase:\n \"O livro [NOME_DO_LIVRO] tem [X] páginas!\"\n */\n-// ?\n+\n+'O livro Mad Max ' + book('Mad Max').quantidadePaginas + ' páginas!'  \n+// \"O livro Mad Max 301 páginas!\"\n \n /*\n Ainda com a função acima, imprima o nome do autor de um livro qualquer, usando\n a frase:\n \"O autor do livro [NOME_DO_LIVRO] é [AUTOR].\"\n */\n-// ?\n+'O autor do livro Mad Max é ' + book('Mad Max').autor + '.';  \n+\n \n /*\n Ainda com a função acima, imprima o nome da editora de um livro qualquer, usando\n a frase:\n \"O livro [NOME_DO_LIVRO] foi publicado pela editora [NOME_DA_EDITORA].\"\n */\n-// ?\n\\ No newline at end of file\n+'O livro Mad Max foi publicado pela editora ' + book('Mad Max').editora + '.'; ","path":"challenge-05/challenge-05.js","position":107,"original_position":107,"commit_id":"27557fe0394d5e9279f4cf9825a4143a0592a2b2","original_commit_id":"27557fe0394d5e9279f4cf9825a4143a0592a2b2","user":{"login":"fdaciuk","id":487669,"avatar_url":"https://avatars.githubusercontent.com/u/487669?v=3","gravatar_id":"","url":"https://api.github.com/users/fdaciuk","html_url":"https://github.com/fdaciuk","followers_url":"https://api.github.com/users/fdaciuk/followers","following_url":"https://api.github.com/users/fdaciuk/following{/other_user}","gists_url":"https://api.github.com/users/fdaciuk/gists{/gist_id}","starred_url":"https://api.github.com/users/fdaciuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fdaciuk/subscriptions","organizations_url":"https://api.github.com/users/fdaciuk/orgs","repos_url":"https://api.github.com/users/fdaciuk/repos","events_url":"https://api.github.com/users/fdaciuk/events{/privacy}","received_events_url":"https://api.github.com/users/fdaciuk/received_events","type":"User","site_admin":false},"body":"-1\r\nMostrar no console","created_at":"2015-09-06T09:03:15Z","updated_at":"2015-09-06T09:03:15Z","html_url":"https://github.com/da2k/curso-javascript-ninja/pull/309#discussion_r38819330","pull_request_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/pulls/309","_links":{"self":{"href":"https://api.github.com/repos/da2k/curso-javascript-ninja/pulls/comments/38819330"},"html":{"href":"https://github.com/da2k/curso-javascript-ninja/pull/309#discussion_r38819330"},"pull_request":{"href":"https://api.github.com/repos/da2k/curso-javascript-ninja/pulls/309"}}},"pull_request":{"url":"https://api.github.com/repos/da2k/curso-javascript-ninja/pulls/309","id":44295090,"html_url":"https://github.com/da2k/curso-javascript-ninja/pull/309","diff_url":"https://github.com/da2k/curso-javascript-ninja/pull/309.diff","patch_url":"https://github.com/da2k/curso-javascript-ninja/pull/309.patch","issue_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/issues/309","number":309,"state":"open","locked":false,"title":"Challenge 05","user":{"login":"ffabiorj","id":6344265,"avatar_url":"https://avatars.githubusercontent.com/u/6344265?v=3","gravatar_id":"","url":"https://api.github.com/users/ffabiorj","html_url":"https://github.com/ffabiorj","followers_url":"https://api.github.com/users/ffabiorj/followers","following_url":"https://api.github.com/users/ffabiorj/following{/other_user}","gists_url":"https://api.github.com/users/ffabiorj/gists{/gist_id}","starred_url":"https://api.github.com/users/ffabiorj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ffabiorj/subscriptions","organizations_url":"https://api.github.com/users/ffabiorj/orgs","repos_url":"https://api.github.com/users/ffabiorj/repos","events_url":"https://api.github.com/users/ffabiorj/events{/privacy}","received_events_url":"https://api.github.com/users/ffabiorj/received_events","type":"User","site_admin":false},"body":"@fdaciuk \r\n\r\nda uma olhada ai.","created_at":"2015-09-06T03:58:16Z","updated_at":"2015-09-06T09:03:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c3a2dfb79ce1dff3a9a5d4faab83937432fc120d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/pulls/309/commits","review_comments_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/pulls/309/comments","review_comment_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/pulls/comments{/number}","comments_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/issues/309/comments","statuses_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/statuses/27557fe0394d5e9279f4cf9825a4143a0592a2b2","head":{"label":"ffabiorj:challenge-05","ref":"challenge-05","sha":"27557fe0394d5e9279f4cf9825a4143a0592a2b2","user":{"login":"ffabiorj","id":6344265,"avatar_url":"https://avatars.githubusercontent.com/u/6344265?v=3","gravatar_id":"","url":"https://api.github.com/users/ffabiorj","html_url":"https://github.com/ffabiorj","followers_url":"https://api.github.com/users/ffabiorj/followers","following_url":"https://api.github.com/users/ffabiorj/following{/other_user}","gists_url":"https://api.github.com/users/ffabiorj/gists{/gist_id}","starred_url":"https://api.github.com/users/ffabiorj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ffabiorj/subscriptions","organizations_url":"https://api.github.com/users/ffabiorj/orgs","repos_url":"https://api.github.com/users/ffabiorj/repos","events_url":"https://api.github.com/users/ffabiorj/events{/privacy}","received_events_url":"https://api.github.com/users/ffabiorj/received_events","type":"User","site_admin":false},"repo":{"id":41522283,"name":"curso-javascript-ninja","full_name":"ffabiorj/curso-javascript-ninja","owner":{"login":"ffabiorj","id":6344265,"avatar_url":"https://avatars.githubusercontent.com/u/6344265?v=3","gravatar_id":"","url":"https://api.github.com/users/ffabiorj","html_url":"https://github.com/ffabiorj","followers_url":"https://api.github.com/users/ffabiorj/followers","following_url":"https://api.github.com/users/ffabiorj/following{/other_user}","gists_url":"https://api.github.com/users/ffabiorj/gists{/gist_id}","starred_url":"https://api.github.com/users/ffabiorj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ffabiorj/subscriptions","organizations_url":"https://api.github.com/users/ffabiorj/orgs","repos_url":"https://api.github.com/users/ffabiorj/repos","events_url":"https://api.github.com/users/ffabiorj/events{/privacy}","received_events_url":"https://api.github.com/users/ffabiorj/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ffabiorj/curso-javascript-ninja","description":"Curso Javascript Ninja","fork":true,"url":"https://api.github.com/repos/ffabiorj/curso-javascript-ninja","forks_url":"https://api.github.com/repos/ffabiorj/curso-javascript-ninja/forks","keys_url":"https://api.github.com/repos/ffabiorj/curso-javascript-ninja/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ffabiorj/curso-javascript-ninja/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ffabiorj/curso-javascript-ninja/teams","hooks_url":"https://api.github.com/repos/ffabiorj/curso-javascript-ninja/hooks","issue_events_url":"https://api.github.com/repos/ffabiorj/curso-javascript-ninja/issues/events{/number}","events_url":"https://api.github.com/repos/ffabiorj/curso-javascript-ninja/events","assignees_url":"https://api.github.com/repos/ffabiorj/curso-javascript-ninja/assignees{/user}","branches_url":"https://api.github.com/repos/ffabiorj/curso-javascript-ninja/branches{/branch}","tags_url":"https://api.github.com/repos/ffabiorj/curso-javascript-ninja/tags","blobs_url":"https://api.github.com/repos/ffabiorj/curso-javascript-ninja/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ffabiorj/curso-javascript-ninja/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ffabiorj/curso-javascript-ninja/git/refs{/sha}","trees_url":"https://api.github.com/repos/ffabiorj/curso-javascript-ninja/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ffabiorj/curso-javascript-ninja/statuses/{sha}","languages_url":"https://api.github.com/repos/ffabiorj/curso-javascript-ninja/languages","stargazers_url":"https://api.github.com/repos/ffabiorj/curso-javascript-ninja/stargazers","contributors_url":"https://api.github.com/repos/ffabiorj/curso-javascript-ninja/contributors","subscribers_url":"https://api.github.com/repos/ffabiorj/curso-javascript-ninja/subscribers","subscription_url":"https://api.github.com/repos/ffabiorj/curso-javascript-ninja/subscription","commits_url":"https://api.github.com/repos/ffabiorj/curso-javascript-ninja/commits{/sha}","git_commits_url":"https://api.github.com/repos/ffabiorj/curso-javascript-ninja/git/commits{/sha}","comments_url":"https://api.github.com/repos/ffabiorj/curso-javascript-ninja/comments{/number}","issue_comment_url":"https://api.github.com/repos/ffabiorj/curso-javascript-ninja/issues/comments{/number}","contents_url":"https://api.github.com/repos/ffabiorj/curso-javascript-ninja/contents/{+path}","compare_url":"https://api.github.com/repos/ffabiorj/curso-javascript-ninja/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ffabiorj/curso-javascript-ninja/merges","archive_url":"https://api.github.com/repos/ffabiorj/curso-javascript-ninja/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ffabiorj/curso-javascript-ninja/downloads","issues_url":"https://api.github.com/repos/ffabiorj/curso-javascript-ninja/issues{/number}","pulls_url":"https://api.github.com/repos/ffabiorj/curso-javascript-ninja/pulls{/number}","milestones_url":"https://api.github.com/repos/ffabiorj/curso-javascript-ninja/milestones{/number}","notifications_url":"https://api.github.com/repos/ffabiorj/curso-javascript-ninja/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ffabiorj/curso-javascript-ninja/labels{/name}","releases_url":"https://api.github.com/repos/ffabiorj/curso-javascript-ninja/releases{/id}","created_at":"2015-08-28T02:25:59Z","updated_at":"2015-08-28T02:26:02Z","pushed_at":"2015-09-06T03:55:15Z","git_url":"git://github.com/ffabiorj/curso-javascript-ninja.git","ssh_url":"git@github.com:ffabiorj/curso-javascript-ninja.git","clone_url":"https://github.com/ffabiorj/curso-javascript-ninja.git","svn_url":"https://github.com/ffabiorj/curso-javascript-ninja","homepage":"http://blog.da2k.com.br/curso-javascript-ninja/","size":154,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"da2k:master","ref":"master","sha":"f140e3fd72bc283de18034085da8ef102696d4bb","user":{"login":"da2k","id":11011075,"avatar_url":"https://avatars.githubusercontent.com/u/11011075?v=3","gravatar_id":"","url":"https://api.github.com/users/da2k","html_url":"https://github.com/da2k","followers_url":"https://api.github.com/users/da2k/followers","following_url":"https://api.github.com/users/da2k/following{/other_user}","gists_url":"https://api.github.com/users/da2k/gists{/gist_id}","starred_url":"https://api.github.com/users/da2k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/da2k/subscriptions","organizations_url":"https://api.github.com/users/da2k/orgs","repos_url":"https://api.github.com/users/da2k/repos","events_url":"https://api.github.com/users/da2k/events{/privacy}","received_events_url":"https://api.github.com/users/da2k/received_events","type":"Organization","site_admin":false},"repo":{"id":30896610,"name":"curso-javascript-ninja","full_name":"da2k/curso-javascript-ninja","owner":{"login":"da2k","id":11011075,"avatar_url":"https://avatars.githubusercontent.com/u/11011075?v=3","gravatar_id":"","url":"https://api.github.com/users/da2k","html_url":"https://github.com/da2k","followers_url":"https://api.github.com/users/da2k/followers","following_url":"https://api.github.com/users/da2k/following{/other_user}","gists_url":"https://api.github.com/users/da2k/gists{/gist_id}","starred_url":"https://api.github.com/users/da2k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/da2k/subscriptions","organizations_url":"https://api.github.com/users/da2k/orgs","repos_url":"https://api.github.com/users/da2k/repos","events_url":"https://api.github.com/users/da2k/events{/privacy}","received_events_url":"https://api.github.com/users/da2k/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/da2k/curso-javascript-ninja","description":"Curso Javascript Ninja","fork":false,"url":"https://api.github.com/repos/da2k/curso-javascript-ninja","forks_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/forks","keys_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/keys{/key_id}","collaborators_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/teams","hooks_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/hooks","issue_events_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/issues/events{/number}","events_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/events","assignees_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/assignees{/user}","branches_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/branches{/branch}","tags_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/tags","blobs_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/git/refs{/sha}","trees_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/git/trees{/sha}","statuses_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/statuses/{sha}","languages_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/languages","stargazers_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/stargazers","contributors_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/contributors","subscribers_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/subscribers","subscription_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/subscription","commits_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/commits{/sha}","git_commits_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/git/commits{/sha}","comments_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/comments{/number}","issue_comment_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/issues/comments{/number}","contents_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/contents/{+path}","compare_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/compare/{base}...{head}","merges_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/merges","archive_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/downloads","issues_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/issues{/number}","pulls_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/pulls{/number}","milestones_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/milestones{/number}","notifications_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/labels{/name}","releases_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/releases{/id}","created_at":"2015-02-17T00:57:58Z","updated_at":"2015-08-28T02:25:52Z","pushed_at":"2015-09-06T05:18:54Z","git_url":"git://github.com/da2k/curso-javascript-ninja.git","ssh_url":"git@github.com:da2k/curso-javascript-ninja.git","clone_url":"https://github.com/da2k/curso-javascript-ninja.git","svn_url":"https://github.com/da2k/curso-javascript-ninja","homepage":"http://blog.da2k.com.br/curso-javascript-ninja/","size":2717,"stargazers_count":36,"watchers_count":36,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":41,"mirror_url":null,"open_issues_count":37,"forks":41,"open_issues":37,"watchers":36,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/da2k/curso-javascript-ninja/pulls/309"},"html":{"href":"https://github.com/da2k/curso-javascript-ninja/pull/309"},"issue":{"href":"https://api.github.com/repos/da2k/curso-javascript-ninja/issues/309"},"comments":{"href":"https://api.github.com/repos/da2k/curso-javascript-ninja/issues/309/comments"},"review_comments":{"href":"https://api.github.com/repos/da2k/curso-javascript-ninja/pulls/309/comments"},"review_comment":{"href":"https://api.github.com/repos/da2k/curso-javascript-ninja/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/da2k/curso-javascript-ninja/pulls/309/commits"},"statuses":{"href":"https://api.github.com/repos/da2k/curso-javascript-ninja/statuses/27557fe0394d5e9279f4cf9825a4143a0592a2b2"}}}}