{"action":"created","comment":{"url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/pulls/comments/42319350","id":42319350,"diff_hunk":"@@ -17,18 +35,32 @@ module.exports.add = function add(name, phone, email) {\n    Поиск ведется по всем полям.\n */\n module.exports.find = function find(query) {\n-\n-    // Ваша удивительная магия здесь\n-\n+    if (query === '') {\n+        for (var i = 0; i < phoneBook.length; ++i) {\n+            console.log(phoneBook[i].name + ' ' + phoneBook[i].phone + ' ' + phoneBook[i].email);\n+        }\n+    } else {\n+        for (var i = 0; i < phoneBook.length; ++i) {\n+            if (phoneBook[i].name.indexOf(query) !== -1 || phoneBook[i].phone.indexOf(query) !== -1 || phoneBook[i].email.indexOf(query) !== -1) {","path":"phoneBook.js","position":51,"original_position":51,"commit_id":"6ba96b61117cf82fbd105357c05acdfdbc4fca0f","original_commit_id":"6ba96b61117cf82fbd105357c05acdfdbc4fca0f","user":{"login":"mangin","id":7918881,"avatar_url":"https://avatars.githubusercontent.com/u/7918881?v=3","gravatar_id":"","url":"https://api.github.com/users/mangin","html_url":"https://github.com/mangin","followers_url":"https://api.github.com/users/mangin/followers","following_url":"https://api.github.com/users/mangin/following{/other_user}","gists_url":"https://api.github.com/users/mangin/gists{/gist_id}","starred_url":"https://api.github.com/users/mangin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mangin/subscriptions","organizations_url":"https://api.github.com/users/mangin/orgs","repos_url":"https://api.github.com/users/mangin/repos","events_url":"https://api.github.com/users/mangin/events{/privacy}","received_events_url":"https://api.github.com/users/mangin/received_events","type":"User","site_admin":false},"body":"у вас проверка на то что запись удоволетворяет запросу повторяется много много раз, может ее вынесем в функцию?","created_at":"2015-10-18T10:07:14Z","updated_at":"2015-10-18T10:07:14Z","html_url":"https://github.com/urfu-2015/javascript-tasks-2/pull/20#discussion_r42319350","pull_request_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/pulls/20","_links":{"self":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/pulls/comments/42319350"},"html":{"href":"https://github.com/urfu-2015/javascript-tasks-2/pull/20#discussion_r42319350"},"pull_request":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/pulls/20"}}},"pull_request":{"url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/pulls/20","id":47339404,"html_url":"https://github.com/urfu-2015/javascript-tasks-2/pull/20","diff_url":"https://github.com/urfu-2015/javascript-tasks-2/pull/20.diff","patch_url":"https://github.com/urfu-2015/javascript-tasks-2/pull/20.patch","issue_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/issues/20","number":20,"state":"open","locked":false,"title":"Корабельникова Татьяна","user":{"login":"eimic","id":10534055,"avatar_url":"https://avatars.githubusercontent.com/u/10534055?v=3","gravatar_id":"","url":"https://api.github.com/users/eimic","html_url":"https://github.com/eimic","followers_url":"https://api.github.com/users/eimic/followers","following_url":"https://api.github.com/users/eimic/following{/other_user}","gists_url":"https://api.github.com/users/eimic/gists{/gist_id}","starred_url":"https://api.github.com/users/eimic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eimic/subscriptions","organizations_url":"https://api.github.com/users/eimic/orgs","repos_url":"https://api.github.com/users/eimic/repos","events_url":"https://api.github.com/users/eimic/events{/privacy}","received_events_url":"https://api.github.com/users/eimic/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-10T06:59:08Z","updated_at":"2015-10-18T10:07:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"88f53b2d77d22141b85404af0d0a578f78bbcbcb","assignee":{"login":"mangin","id":7918881,"avatar_url":"https://avatars.githubusercontent.com/u/7918881?v=3","gravatar_id":"","url":"https://api.github.com/users/mangin","html_url":"https://github.com/mangin","followers_url":"https://api.github.com/users/mangin/followers","following_url":"https://api.github.com/users/mangin/following{/other_user}","gists_url":"https://api.github.com/users/mangin/gists{/gist_id}","starred_url":"https://api.github.com/users/mangin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mangin/subscriptions","organizations_url":"https://api.github.com/users/mangin/orgs","repos_url":"https://api.github.com/users/mangin/repos","events_url":"https://api.github.com/users/mangin/events{/privacy}","received_events_url":"https://api.github.com/users/mangin/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/pulls/20/commits","review_comments_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/pulls/20/comments","review_comment_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/issues/20/comments","statuses_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/statuses/6ba96b61117cf82fbd105357c05acdfdbc4fca0f","head":{"label":"eimic:master","ref":"master","sha":"6ba96b61117cf82fbd105357c05acdfdbc4fca0f","user":{"login":"eimic","id":10534055,"avatar_url":"https://avatars.githubusercontent.com/u/10534055?v=3","gravatar_id":"","url":"https://api.github.com/users/eimic","html_url":"https://github.com/eimic","followers_url":"https://api.github.com/users/eimic/followers","following_url":"https://api.github.com/users/eimic/following{/other_user}","gists_url":"https://api.github.com/users/eimic/gists{/gist_id}","starred_url":"https://api.github.com/users/eimic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eimic/subscriptions","organizations_url":"https://api.github.com/users/eimic/orgs","repos_url":"https://api.github.com/users/eimic/repos","events_url":"https://api.github.com/users/eimic/events{/privacy}","received_events_url":"https://api.github.com/users/eimic/received_events","type":"User","site_admin":false},"repo":{"id":43860686,"name":"javascript-tasks-2","full_name":"eimic/javascript-tasks-2","owner":{"login":"eimic","id":10534055,"avatar_url":"https://avatars.githubusercontent.com/u/10534055?v=3","gravatar_id":"","url":"https://api.github.com/users/eimic","html_url":"https://github.com/eimic","followers_url":"https://api.github.com/users/eimic/followers","following_url":"https://api.github.com/users/eimic/following{/other_user}","gists_url":"https://api.github.com/users/eimic/gists{/gist_id}","starred_url":"https://api.github.com/users/eimic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eimic/subscriptions","organizations_url":"https://api.github.com/users/eimic/orgs","repos_url":"https://api.github.com/users/eimic/repos","events_url":"https://api.github.com/users/eimic/events{/privacy}","received_events_url":"https://api.github.com/users/eimic/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/eimic/javascript-tasks-2","description":"Задача к лекции «Основы Javascript» – «Телефонная книга»","fork":true,"url":"https://api.github.com/repos/eimic/javascript-tasks-2","forks_url":"https://api.github.com/repos/eimic/javascript-tasks-2/forks","keys_url":"https://api.github.com/repos/eimic/javascript-tasks-2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eimic/javascript-tasks-2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eimic/javascript-tasks-2/teams","hooks_url":"https://api.github.com/repos/eimic/javascript-tasks-2/hooks","issue_events_url":"https://api.github.com/repos/eimic/javascript-tasks-2/issues/events{/number}","events_url":"https://api.github.com/repos/eimic/javascript-tasks-2/events","assignees_url":"https://api.github.com/repos/eimic/javascript-tasks-2/assignees{/user}","branches_url":"https://api.github.com/repos/eimic/javascript-tasks-2/branches{/branch}","tags_url":"https://api.github.com/repos/eimic/javascript-tasks-2/tags","blobs_url":"https://api.github.com/repos/eimic/javascript-tasks-2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eimic/javascript-tasks-2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eimic/javascript-tasks-2/git/refs{/sha}","trees_url":"https://api.github.com/repos/eimic/javascript-tasks-2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eimic/javascript-tasks-2/statuses/{sha}","languages_url":"https://api.github.com/repos/eimic/javascript-tasks-2/languages","stargazers_url":"https://api.github.com/repos/eimic/javascript-tasks-2/stargazers","contributors_url":"https://api.github.com/repos/eimic/javascript-tasks-2/contributors","subscribers_url":"https://api.github.com/repos/eimic/javascript-tasks-2/subscribers","subscription_url":"https://api.github.com/repos/eimic/javascript-tasks-2/subscription","commits_url":"https://api.github.com/repos/eimic/javascript-tasks-2/commits{/sha}","git_commits_url":"https://api.github.com/repos/eimic/javascript-tasks-2/git/commits{/sha}","comments_url":"https://api.github.com/repos/eimic/javascript-tasks-2/comments{/number}","issue_comment_url":"https://api.github.com/repos/eimic/javascript-tasks-2/issues/comments{/number}","contents_url":"https://api.github.com/repos/eimic/javascript-tasks-2/contents/{+path}","compare_url":"https://api.github.com/repos/eimic/javascript-tasks-2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eimic/javascript-tasks-2/merges","archive_url":"https://api.github.com/repos/eimic/javascript-tasks-2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eimic/javascript-tasks-2/downloads","issues_url":"https://api.github.com/repos/eimic/javascript-tasks-2/issues{/number}","pulls_url":"https://api.github.com/repos/eimic/javascript-tasks-2/pulls{/number}","milestones_url":"https://api.github.com/repos/eimic/javascript-tasks-2/milestones{/number}","notifications_url":"https://api.github.com/repos/eimic/javascript-tasks-2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eimic/javascript-tasks-2/labels{/name}","releases_url":"https://api.github.com/repos/eimic/javascript-tasks-2/releases{/id}","created_at":"2015-10-08T03:40:08Z","updated_at":"2015-10-08T03:40:09Z","pushed_at":"2015-10-16T14:54:40Z","git_url":"git://github.com/eimic/javascript-tasks-2.git","ssh_url":"git@github.com:eimic/javascript-tasks-2.git","clone_url":"https://github.com/eimic/javascript-tasks-2.git","svn_url":"https://github.com/eimic/javascript-tasks-2","homepage":"","size":105,"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":"urfu-2015:master","ref":"master","sha":"8964185d6a3c6c2b9c54b4480137e874d6fbd374","user":{"login":"urfu-2015","id":14800971,"avatar_url":"https://avatars.githubusercontent.com/u/14800971?v=3","gravatar_id":"","url":"https://api.github.com/users/urfu-2015","html_url":"https://github.com/urfu-2015","followers_url":"https://api.github.com/users/urfu-2015/followers","following_url":"https://api.github.com/users/urfu-2015/following{/other_user}","gists_url":"https://api.github.com/users/urfu-2015/gists{/gist_id}","starred_url":"https://api.github.com/users/urfu-2015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/urfu-2015/subscriptions","organizations_url":"https://api.github.com/users/urfu-2015/orgs","repos_url":"https://api.github.com/users/urfu-2015/repos","events_url":"https://api.github.com/users/urfu-2015/events{/privacy}","received_events_url":"https://api.github.com/users/urfu-2015/received_events","type":"Organization","site_admin":false},"repo":{"id":43743710,"name":"javascript-tasks-2","full_name":"urfu-2015/javascript-tasks-2","owner":{"login":"urfu-2015","id":14800971,"avatar_url":"https://avatars.githubusercontent.com/u/14800971?v=3","gravatar_id":"","url":"https://api.github.com/users/urfu-2015","html_url":"https://github.com/urfu-2015","followers_url":"https://api.github.com/users/urfu-2015/followers","following_url":"https://api.github.com/users/urfu-2015/following{/other_user}","gists_url":"https://api.github.com/users/urfu-2015/gists{/gist_id}","starred_url":"https://api.github.com/users/urfu-2015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/urfu-2015/subscriptions","organizations_url":"https://api.github.com/users/urfu-2015/orgs","repos_url":"https://api.github.com/users/urfu-2015/repos","events_url":"https://api.github.com/users/urfu-2015/events{/privacy}","received_events_url":"https://api.github.com/users/urfu-2015/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/urfu-2015/javascript-tasks-2","description":"Задача к лекции «Основы Javascript» – «Телефонная книга»","fork":false,"url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2","forks_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/forks","keys_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/teams","hooks_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/hooks","issue_events_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/issues/events{/number}","events_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/events","assignees_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/assignees{/user}","branches_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/branches{/branch}","tags_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/tags","blobs_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/git/refs{/sha}","trees_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/statuses/{sha}","languages_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/languages","stargazers_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/stargazers","contributors_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/contributors","subscribers_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/subscribers","subscription_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/subscription","commits_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/commits{/sha}","git_commits_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/git/commits{/sha}","comments_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/comments{/number}","issue_comment_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/issues/comments{/number}","contents_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/contents/{+path}","compare_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/merges","archive_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/downloads","issues_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/issues{/number}","pulls_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/pulls{/number}","milestones_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/milestones{/number}","notifications_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/labels{/name}","releases_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/releases{/id}","created_at":"2015-10-06T10:22:05Z","updated_at":"2015-10-10T17:56:49Z","pushed_at":"2015-10-18T09:51:38Z","git_url":"git://github.com/urfu-2015/javascript-tasks-2.git","ssh_url":"git@github.com:urfu-2015/javascript-tasks-2.git","clone_url":"https://github.com/urfu-2015/javascript-tasks-2.git","svn_url":"https://github.com/urfu-2015/javascript-tasks-2","homepage":"","size":1563,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":97,"mirror_url":null,"open_issues_count":59,"forks":97,"open_issues":59,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/pulls/20"},"html":{"href":"https://github.com/urfu-2015/javascript-tasks-2/pull/20"},"issue":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/issues/20"},"comments":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/issues/20/comments"},"review_comments":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/pulls/20/comments"},"review_comment":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/pulls/20/commits"},"statuses":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/statuses/6ba96b61117cf82fbd105357c05acdfdbc4fca0f"}}}}