{"action":"created","comment":{"url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/pulls/comments/42461032","id":42461032,"diff_hunk":"@@ -17,36 +84,33 @@ module.exports.add = function add(name, phone, email) {\n    Поиск ведется по всем полям.\n */\n module.exports.find = function find(query) {\n+  console.log(\"start find\");\n+  var foundRes = [];\n+\n+  if (!query) {\n+    foundRes = phoneBook;\n+  } else {\n+    foundRes = findInArray(phoneBook, query);\n+  }\n \n-    // Ваша удивительная магия здесь\n+  foundRes.forEach(function(person){\n+    console.log(\"%s, %s, %s\", person.name, person.phone, person.email);\n+  } )\n \n+  return foundRes;\n };\n \n /*\n    Функция удаления записи в телефонной книге.\n */\n module.exports.remove = function remove(query) {\n-\n-    // Ваша необьяснимая магия здесь\n-\n-};\n-\n-/*\n-   Функция импорта записей из файла (задача со звёздочкой!).\n-*/\n-module.exports.importFromCsv = function importFromCsv(filename) {\n-    var data = require('fs').readFileSync(filename, 'utf-8');\n-\n-    // Ваша чёрная магия:\n-    // - Разбираете записи из `data`\n-    // - Добавляете каждую запись в книгу\n-};\n-\n-/*\n-   Функция вывода всех телефонов в виде ASCII (задача со звёздочкой!).\n-*/\n-module.exports.showTable = function showTable() {\n-\n-    // Ваша чёрная магия здесь\n-\n+  console.log('start delete');\n+  var countDelete = 0;\n+  var deleteElements = findInArray(phoneBook, query, true);","path":"phoneBook.js","position":134,"original_position":134,"commit_id":"7dd3fe6bdf2ea96edc10eeea166189c5bcec7685","original_commit_id":"7dd3fe6bdf2ea96edc10eeea166189c5bcec7685","user":{"login":"gogoleff","id":4534405,"avatar_url":"https://avatars.githubusercontent.com/u/4534405?v=3","gravatar_id":"","url":"https://api.github.com/users/gogoleff","html_url":"https://github.com/gogoleff","followers_url":"https://api.github.com/users/gogoleff/followers","following_url":"https://api.github.com/users/gogoleff/following{/other_user}","gists_url":"https://api.github.com/users/gogoleff/gists{/gist_id}","starred_url":"https://api.github.com/users/gogoleff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gogoleff/subscriptions","organizations_url":"https://api.github.com/users/gogoleff/orgs","repos_url":"https://api.github.com/users/gogoleff/repos","events_url":"https://api.github.com/users/gogoleff/events{/privacy}","received_events_url":"https://api.github.com/users/gogoleff/received_events","type":"User","site_admin":false},"body":"Но вместо параметра можно сделать два помощника:\r\nfindValues(phoneBook, query), findIndexes(phoneBook, query), а внутри каждого просто вызывать `findInArray` с тем или иным последним параметром.\r\n\r\nКод будет чуть проще читать.","created_at":"2015-10-20T06:48:48Z","updated_at":"2015-10-20T06:48:48Z","html_url":"https://github.com/urfu-2015/javascript-tasks-2/pull/60#discussion_r42461032","pull_request_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/pulls/60","_links":{"self":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/pulls/comments/42461032"},"html":{"href":"https://github.com/urfu-2015/javascript-tasks-2/pull/60#discussion_r42461032"},"pull_request":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/pulls/60"}}},"pull_request":{"url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/pulls/60","id":47448655,"html_url":"https://github.com/urfu-2015/javascript-tasks-2/pull/60","diff_url":"https://github.com/urfu-2015/javascript-tasks-2/pull/60.diff","patch_url":"https://github.com/urfu-2015/javascript-tasks-2/pull/60.patch","issue_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/issues/60","number":60,"state":"open","locked":false,"title":"Кладов Валерий","user":{"login":"KladovValery","id":14982426,"avatar_url":"https://avatars.githubusercontent.com/u/14982426?v=3","gravatar_id":"","url":"https://api.github.com/users/KladovValery","html_url":"https://github.com/KladovValery","followers_url":"https://api.github.com/users/KladovValery/followers","following_url":"https://api.github.com/users/KladovValery/following{/other_user}","gists_url":"https://api.github.com/users/KladovValery/gists{/gist_id}","starred_url":"https://api.github.com/users/KladovValery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KladovValery/subscriptions","organizations_url":"https://api.github.com/users/KladovValery/orgs","repos_url":"https://api.github.com/users/KladovValery/repos","events_url":"https://api.github.com/users/KladovValery/events{/privacy}","received_events_url":"https://api.github.com/users/KladovValery/received_events","type":"User","site_admin":false},"body":"Делали вместе с Tkach. Немного там не получается что-то...","created_at":"2015-10-12T18:12:41Z","updated_at":"2015-10-20T06:48:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fda4e3fcf3291a1392b84b106d2b63218402aaba","assignee":{"login":"gogoleff","id":4534405,"avatar_url":"https://avatars.githubusercontent.com/u/4534405?v=3","gravatar_id":"","url":"https://api.github.com/users/gogoleff","html_url":"https://github.com/gogoleff","followers_url":"https://api.github.com/users/gogoleff/followers","following_url":"https://api.github.com/users/gogoleff/following{/other_user}","gists_url":"https://api.github.com/users/gogoleff/gists{/gist_id}","starred_url":"https://api.github.com/users/gogoleff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gogoleff/subscriptions","organizations_url":"https://api.github.com/users/gogoleff/orgs","repos_url":"https://api.github.com/users/gogoleff/repos","events_url":"https://api.github.com/users/gogoleff/events{/privacy}","received_events_url":"https://api.github.com/users/gogoleff/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/pulls/60/commits","review_comments_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/pulls/60/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/60/comments","statuses_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/statuses/7dd3fe6bdf2ea96edc10eeea166189c5bcec7685","head":{"label":"KladovValery:master","ref":"master","sha":"7dd3fe6bdf2ea96edc10eeea166189c5bcec7685","user":{"login":"KladovValery","id":14982426,"avatar_url":"https://avatars.githubusercontent.com/u/14982426?v=3","gravatar_id":"","url":"https://api.github.com/users/KladovValery","html_url":"https://github.com/KladovValery","followers_url":"https://api.github.com/users/KladovValery/followers","following_url":"https://api.github.com/users/KladovValery/following{/other_user}","gists_url":"https://api.github.com/users/KladovValery/gists{/gist_id}","starred_url":"https://api.github.com/users/KladovValery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KladovValery/subscriptions","organizations_url":"https://api.github.com/users/KladovValery/orgs","repos_url":"https://api.github.com/users/KladovValery/repos","events_url":"https://api.github.com/users/KladovValery/events{/privacy}","received_events_url":"https://api.github.com/users/KladovValery/received_events","type":"User","site_admin":false},"repo":{"id":44124984,"name":"javascript-tasks-2","full_name":"KladovValery/javascript-tasks-2","owner":{"login":"KladovValery","id":14982426,"avatar_url":"https://avatars.githubusercontent.com/u/14982426?v=3","gravatar_id":"","url":"https://api.github.com/users/KladovValery","html_url":"https://github.com/KladovValery","followers_url":"https://api.github.com/users/KladovValery/followers","following_url":"https://api.github.com/users/KladovValery/following{/other_user}","gists_url":"https://api.github.com/users/KladovValery/gists{/gist_id}","starred_url":"https://api.github.com/users/KladovValery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KladovValery/subscriptions","organizations_url":"https://api.github.com/users/KladovValery/orgs","repos_url":"https://api.github.com/users/KladovValery/repos","events_url":"https://api.github.com/users/KladovValery/events{/privacy}","received_events_url":"https://api.github.com/users/KladovValery/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/KladovValery/javascript-tasks-2","description":"Задача к лекции «Основы Javascript» – «Телефонная книга»","fork":true,"url":"https://api.github.com/repos/KladovValery/javascript-tasks-2","forks_url":"https://api.github.com/repos/KladovValery/javascript-tasks-2/forks","keys_url":"https://api.github.com/repos/KladovValery/javascript-tasks-2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KladovValery/javascript-tasks-2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KladovValery/javascript-tasks-2/teams","hooks_url":"https://api.github.com/repos/KladovValery/javascript-tasks-2/hooks","issue_events_url":"https://api.github.com/repos/KladovValery/javascript-tasks-2/issues/events{/number}","events_url":"https://api.github.com/repos/KladovValery/javascript-tasks-2/events","assignees_url":"https://api.github.com/repos/KladovValery/javascript-tasks-2/assignees{/user}","branches_url":"https://api.github.com/repos/KladovValery/javascript-tasks-2/branches{/branch}","tags_url":"https://api.github.com/repos/KladovValery/javascript-tasks-2/tags","blobs_url":"https://api.github.com/repos/KladovValery/javascript-tasks-2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KladovValery/javascript-tasks-2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KladovValery/javascript-tasks-2/git/refs{/sha}","trees_url":"https://api.github.com/repos/KladovValery/javascript-tasks-2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KladovValery/javascript-tasks-2/statuses/{sha}","languages_url":"https://api.github.com/repos/KladovValery/javascript-tasks-2/languages","stargazers_url":"https://api.github.com/repos/KladovValery/javascript-tasks-2/stargazers","contributors_url":"https://api.github.com/repos/KladovValery/javascript-tasks-2/contributors","subscribers_url":"https://api.github.com/repos/KladovValery/javascript-tasks-2/subscribers","subscription_url":"https://api.github.com/repos/KladovValery/javascript-tasks-2/subscription","commits_url":"https://api.github.com/repos/KladovValery/javascript-tasks-2/commits{/sha}","git_commits_url":"https://api.github.com/repos/KladovValery/javascript-tasks-2/git/commits{/sha}","comments_url":"https://api.github.com/repos/KladovValery/javascript-tasks-2/comments{/number}","issue_comment_url":"https://api.github.com/repos/KladovValery/javascript-tasks-2/issues/comments{/number}","contents_url":"https://api.github.com/repos/KladovValery/javascript-tasks-2/contents/{+path}","compare_url":"https://api.github.com/repos/KladovValery/javascript-tasks-2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KladovValery/javascript-tasks-2/merges","archive_url":"https://api.github.com/repos/KladovValery/javascript-tasks-2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KladovValery/javascript-tasks-2/downloads","issues_url":"https://api.github.com/repos/KladovValery/javascript-tasks-2/issues{/number}","pulls_url":"https://api.github.com/repos/KladovValery/javascript-tasks-2/pulls{/number}","milestones_url":"https://api.github.com/repos/KladovValery/javascript-tasks-2/milestones{/number}","notifications_url":"https://api.github.com/repos/KladovValery/javascript-tasks-2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KladovValery/javascript-tasks-2/labels{/name}","releases_url":"https://api.github.com/repos/KladovValery/javascript-tasks-2/releases{/id}","created_at":"2015-10-12T18:06:02Z","updated_at":"2015-10-12T18:06:03Z","pushed_at":"2015-10-19T16:32:36Z","git_url":"git://github.com/KladovValery/javascript-tasks-2.git","ssh_url":"git@github.com:KladovValery/javascript-tasks-2.git","clone_url":"https://github.com/KladovValery/javascript-tasks-2.git","svn_url":"https://github.com/KladovValery/javascript-tasks-2","homepage":"","size":125,"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-20T06:39:25Z","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":1546,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":98,"mirror_url":null,"open_issues_count":44,"forks":98,"open_issues":44,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/pulls/60"},"html":{"href":"https://github.com/urfu-2015/javascript-tasks-2/pull/60"},"issue":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/issues/60"},"comments":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/issues/60/comments"},"review_comments":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/pulls/60/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/60/commits"},"statuses":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/statuses/7dd3fe6bdf2ea96edc10eeea166189c5bcec7685"}}}}