{"action":"created","comment":{"url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/pulls/comments/41967658","id":41967658,"diff_hunk":"@@ -1,15 +1,22 @@\n 'use strict';\n \n-var phoneBook; // Здесь вы храните записи как хотите\n-\n+var phoneBook = []; // Здесь вы храните записи как хотите\n+var phonere = /^[0-9\\+\\-\\(\\)\\s]+$/;\n+var emailre = /^([a-z0-9._-])*@([a-zа-я0-9_-]+\\.)+([a-zа-я]+)$/;\n /*\n    Функция добавления записи в телефонную книгу.\n    На вход может прийти что угодно, будьте осторожны.\n */\n module.exports.add = function add(name, phone, email) {\n-\n-    // Ваша невероятная магия здесь\n-\n+    if((phonere.test(phone))&&(emailre.test(email))){","path":"phoneBook.js","position":16,"original_position":16,"commit_id":"030d566f77b6c9b09ecf38833660bc1a2e156bfd","original_commit_id":"030d566f77b6c9b09ecf38833660bc1a2e156bfd","user":{"login":"Zhigalov","id":1654243,"avatar_url":"https://avatars.githubusercontent.com/u/1654243?v=3","gravatar_id":"","url":"https://api.github.com/users/Zhigalov","html_url":"https://github.com/Zhigalov","followers_url":"https://api.github.com/users/Zhigalov/followers","following_url":"https://api.github.com/users/Zhigalov/following{/other_user}","gists_url":"https://api.github.com/users/Zhigalov/gists{/gist_id}","starred_url":"https://api.github.com/users/Zhigalov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zhigalov/subscriptions","organizations_url":"https://api.github.com/users/Zhigalov/orgs","repos_url":"https://api.github.com/users/Zhigalov/repos","events_url":"https://api.github.com/users/Zhigalov/events{/privacy}","received_events_url":"https://api.github.com/users/Zhigalov/received_events","type":"User","site_admin":false},"body":"Если функция состоит из одного `if` то лучше писать ее так:\r\n``` javascript\r\nfunction () {\r\n    if (!a) {\r\n        return;\r\n    }\r\n\r\n    //  тут твой старый код\r\n}\r\n```","created_at":"2015-10-14T08:38:47Z","updated_at":"2015-10-14T08:38:47Z","html_url":"https://github.com/urfu-2015/javascript-tasks-2/pull/32#discussion_r41967658","pull_request_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/pulls/32","_links":{"self":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/pulls/comments/41967658"},"html":{"href":"https://github.com/urfu-2015/javascript-tasks-2/pull/32#discussion_r41967658"},"pull_request":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/pulls/32"}}},"pull_request":{"url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/pulls/32","id":47370244,"html_url":"https://github.com/urfu-2015/javascript-tasks-2/pull/32","diff_url":"https://github.com/urfu-2015/javascript-tasks-2/pull/32.diff","patch_url":"https://github.com/urfu-2015/javascript-tasks-2/pull/32.patch","issue_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/issues/32","number":32,"state":"open","locked":false,"title":"Хомич Павел","user":{"login":"paulkhomich","id":14900963,"avatar_url":"https://avatars.githubusercontent.com/u/14900963?v=3","gravatar_id":"","url":"https://api.github.com/users/paulkhomich","html_url":"https://github.com/paulkhomich","followers_url":"https://api.github.com/users/paulkhomich/followers","following_url":"https://api.github.com/users/paulkhomich/following{/other_user}","gists_url":"https://api.github.com/users/paulkhomich/gists{/gist_id}","starred_url":"https://api.github.com/users/paulkhomich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulkhomich/subscriptions","organizations_url":"https://api.github.com/users/paulkhomich/orgs","repos_url":"https://api.github.com/users/paulkhomich/repos","events_url":"https://api.github.com/users/paulkhomich/events{/privacy}","received_events_url":"https://api.github.com/users/paulkhomich/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-11T16:27:52Z","updated_at":"2015-10-14T08:38:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"365b9da17cedc58f6dea9e3582821f895ed8ed8f","assignee":{"login":"Zhigalov","id":1654243,"avatar_url":"https://avatars.githubusercontent.com/u/1654243?v=3","gravatar_id":"","url":"https://api.github.com/users/Zhigalov","html_url":"https://github.com/Zhigalov","followers_url":"https://api.github.com/users/Zhigalov/followers","following_url":"https://api.github.com/users/Zhigalov/following{/other_user}","gists_url":"https://api.github.com/users/Zhigalov/gists{/gist_id}","starred_url":"https://api.github.com/users/Zhigalov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zhigalov/subscriptions","organizations_url":"https://api.github.com/users/Zhigalov/orgs","repos_url":"https://api.github.com/users/Zhigalov/repos","events_url":"https://api.github.com/users/Zhigalov/events{/privacy}","received_events_url":"https://api.github.com/users/Zhigalov/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/pulls/32/commits","review_comments_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/pulls/32/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/32/comments","statuses_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/statuses/030d566f77b6c9b09ecf38833660bc1a2e156bfd","head":{"label":"paulkhomich:master","ref":"master","sha":"030d566f77b6c9b09ecf38833660bc1a2e156bfd","user":{"login":"paulkhomich","id":14900963,"avatar_url":"https://avatars.githubusercontent.com/u/14900963?v=3","gravatar_id":"","url":"https://api.github.com/users/paulkhomich","html_url":"https://github.com/paulkhomich","followers_url":"https://api.github.com/users/paulkhomich/followers","following_url":"https://api.github.com/users/paulkhomich/following{/other_user}","gists_url":"https://api.github.com/users/paulkhomich/gists{/gist_id}","starred_url":"https://api.github.com/users/paulkhomich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulkhomich/subscriptions","organizations_url":"https://api.github.com/users/paulkhomich/orgs","repos_url":"https://api.github.com/users/paulkhomich/repos","events_url":"https://api.github.com/users/paulkhomich/events{/privacy}","received_events_url":"https://api.github.com/users/paulkhomich/received_events","type":"User","site_admin":false},"repo":{"id":44059711,"name":"javascript-tasks-2","full_name":"paulkhomich/javascript-tasks-2","owner":{"login":"paulkhomich","id":14900963,"avatar_url":"https://avatars.githubusercontent.com/u/14900963?v=3","gravatar_id":"","url":"https://api.github.com/users/paulkhomich","html_url":"https://github.com/paulkhomich","followers_url":"https://api.github.com/users/paulkhomich/followers","following_url":"https://api.github.com/users/paulkhomich/following{/other_user}","gists_url":"https://api.github.com/users/paulkhomich/gists{/gist_id}","starred_url":"https://api.github.com/users/paulkhomich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulkhomich/subscriptions","organizations_url":"https://api.github.com/users/paulkhomich/orgs","repos_url":"https://api.github.com/users/paulkhomich/repos","events_url":"https://api.github.com/users/paulkhomich/events{/privacy}","received_events_url":"https://api.github.com/users/paulkhomich/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/paulkhomich/javascript-tasks-2","description":"Задача к лекции «Основы Javascript» – «Телефонная книга»","fork":true,"url":"https://api.github.com/repos/paulkhomich/javascript-tasks-2","forks_url":"https://api.github.com/repos/paulkhomich/javascript-tasks-2/forks","keys_url":"https://api.github.com/repos/paulkhomich/javascript-tasks-2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/paulkhomich/javascript-tasks-2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/paulkhomich/javascript-tasks-2/teams","hooks_url":"https://api.github.com/repos/paulkhomich/javascript-tasks-2/hooks","issue_events_url":"https://api.github.com/repos/paulkhomich/javascript-tasks-2/issues/events{/number}","events_url":"https://api.github.com/repos/paulkhomich/javascript-tasks-2/events","assignees_url":"https://api.github.com/repos/paulkhomich/javascript-tasks-2/assignees{/user}","branches_url":"https://api.github.com/repos/paulkhomich/javascript-tasks-2/branches{/branch}","tags_url":"https://api.github.com/repos/paulkhomich/javascript-tasks-2/tags","blobs_url":"https://api.github.com/repos/paulkhomich/javascript-tasks-2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/paulkhomich/javascript-tasks-2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/paulkhomich/javascript-tasks-2/git/refs{/sha}","trees_url":"https://api.github.com/repos/paulkhomich/javascript-tasks-2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/paulkhomich/javascript-tasks-2/statuses/{sha}","languages_url":"https://api.github.com/repos/paulkhomich/javascript-tasks-2/languages","stargazers_url":"https://api.github.com/repos/paulkhomich/javascript-tasks-2/stargazers","contributors_url":"https://api.github.com/repos/paulkhomich/javascript-tasks-2/contributors","subscribers_url":"https://api.github.com/repos/paulkhomich/javascript-tasks-2/subscribers","subscription_url":"https://api.github.com/repos/paulkhomich/javascript-tasks-2/subscription","commits_url":"https://api.github.com/repos/paulkhomich/javascript-tasks-2/commits{/sha}","git_commits_url":"https://api.github.com/repos/paulkhomich/javascript-tasks-2/git/commits{/sha}","comments_url":"https://api.github.com/repos/paulkhomich/javascript-tasks-2/comments{/number}","issue_comment_url":"https://api.github.com/repos/paulkhomich/javascript-tasks-2/issues/comments{/number}","contents_url":"https://api.github.com/repos/paulkhomich/javascript-tasks-2/contents/{+path}","compare_url":"https://api.github.com/repos/paulkhomich/javascript-tasks-2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/paulkhomich/javascript-tasks-2/merges","archive_url":"https://api.github.com/repos/paulkhomich/javascript-tasks-2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/paulkhomich/javascript-tasks-2/downloads","issues_url":"https://api.github.com/repos/paulkhomich/javascript-tasks-2/issues{/number}","pulls_url":"https://api.github.com/repos/paulkhomich/javascript-tasks-2/pulls{/number}","milestones_url":"https://api.github.com/repos/paulkhomich/javascript-tasks-2/milestones{/number}","notifications_url":"https://api.github.com/repos/paulkhomich/javascript-tasks-2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/paulkhomich/javascript-tasks-2/labels{/name}","releases_url":"https://api.github.com/repos/paulkhomich/javascript-tasks-2/releases{/id}","created_at":"2015-10-11T16:24:11Z","updated_at":"2015-10-11T16:24:12Z","pushed_at":"2015-10-11T16:25:59Z","git_url":"git://github.com/paulkhomich/javascript-tasks-2.git","ssh_url":"git@github.com:paulkhomich/javascript-tasks-2.git","clone_url":"https://github.com/paulkhomich/javascript-tasks-2.git","svn_url":"https://github.com/paulkhomich/javascript-tasks-2","homepage":"","size":101,"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-14T08:14:36Z","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":1334,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":92,"mirror_url":null,"open_issues_count":65,"forks":92,"open_issues":65,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/pulls/32"},"html":{"href":"https://github.com/urfu-2015/javascript-tasks-2/pull/32"},"issue":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/issues/32"},"comments":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/issues/32/comments"},"review_comments":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/pulls/32/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/32/commits"},"statuses":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-2/statuses/030d566f77b6c9b09ecf38833660bc1a2e156bfd"}}}}