{"action":"created","comment":{"url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/pulls/comments/187458303","pull_request_review_id":119245146,"id":187458303,"diff_hunk":"@@ -0,0 +1,192 @@\n+/* ДЗ 3 - работа с исключениями и отладчиком */\n+\n+/*\n+ Задание 1:\n+\n+ 1.1: Функция принимает массив и фильтрующую фукнцию и должна вернуть true или false\n+ Функция должна вернуть true только если fn вернула true для всех элементов массива\n+\n+ 1.2: Необходимо выбрасывать исключение в случаях:\n+   - array не массив или пустой массив (с текстом \"empty array\")\n+   - fn не является функцией (с текстом \"fn is not a function\")\n+\n+ Зарпещено использовать встроенные методы для работы с массивами\n+\n+ Пример:\n+   isAllTrue([1, 2, 3, 4, 5], n => n < 10) // вернет true\n+   isAllTrue([100, 2, 3, 4, 5], n => n < 10) // вернет false\n+ */\n+function isAllTrue(array, fn) {\n+    if (array.length == 0 || !Array.isArray(array)) {\n+        throw new Error('empty array');\n+    }\n+    if (typeof fn != 'function') {\n+        throw new Error('fn is not a function');\n+    }\n+\n+    let result = true;\n+\n+    for (const elem of array) {\n+        if (fn(elem) != true) {\n+            result = false;\n+        }\n+    }\n+\n+    return result;\n+}\n+\n+try {\n+    console.log(isAllTrue([100, 2, 3, 4, 5], 56));\n+} catch (e) {\n+    console.log(e.message);\n+}\n+\n+/*\n+ Задание 2:\n+\n+ 2.1: Функция принимает массив и фильтрующую фукнцию и должна вернуть true или false\n+ Функция должна вернуть true если fn вернула true хотя бы для одного из элементов массива\n+\n+ 2.2: Необходимо выбрасывать исключение в случаях:\n+   - array не массив или пустой массив (с текстом \"empty array\")\n+   - fn не является функцией (с текстом \"fn is not a function\")\n+\n+ Зарпещено использовать встроенные методы для работы с массивами\n+\n+ Пример:\n+   isSomeTrue([1, 2, 30, 4, 5], n => n > 20) // вернет true\n+   isSomeTrue([1, 2, 3, 4, 5], n => n > 20) // вернет false\n+ */\n+function isSomeTrue(array, fn) {\n+    if (array.length == 0 || !Array.isArray(array)) {\n+        throw new Error('empty array');\n+    }\n+    if (typeof fn != 'function') {\n+        throw new Error('fn is not a function');\n+    }\n+\n+    let result = false;\n+\n+    for (const elem of array) {\n+        if (fn(elem) == true) {\n+            result = true;\n+        }\n+    }\n+\n+    return result;\n+}\n+\n+try {\n+    console.log(isSomeTrue([1, 2, 3, 4, 5], n => n > 20));\n+} catch (e) {\n+    console.log(e.message);\n+}\n+\n+/*\n+ Задание 3:\n+\n+ 3.1: Функция принимает заранее неизветсное количество аргументов, первым из которых является функция fn\n+ Функция должна поочередно запустить fn для каждого переданного аргумента (кроме самой fn)\n+\n+ 3.2: Функция должна вернуть массив аргументов, для которых fn выбросила исключение\n+\n+ 3.3: Необходимо выбрасывать исключение в случаях:\n+   - fn не является функцией (с текстом \"fn is not a function\")\n+ */\n+\n+function returnBadArguments(fn, ...rest) {\n+    if (typeof fn != 'function') {\n+        throw new Error('fn is not a function');\n+    }\n+\n+    if (rest.length == 0) {","path":"src/index.js","position":null,"original_position":102,"commit_id":"da4c1053fc8ba8c13b0daa7057dcd76d7a0508c5","original_commit_id":"0ecf75152d4206ce6b7eed8b32d7070b3aa958bc","user":{"login":"IrinaKondrateva","id":35540115,"avatar_url":"https://avatars3.githubusercontent.com/u/35540115?v=4","gravatar_id":"","url":"https://api.github.com/users/IrinaKondrateva","html_url":"https://github.com/IrinaKondrateva","followers_url":"https://api.github.com/users/IrinaKondrateva/followers","following_url":"https://api.github.com/users/IrinaKondrateva/following{/other_user}","gists_url":"https://api.github.com/users/IrinaKondrateva/gists{/gist_id}","starred_url":"https://api.github.com/users/IrinaKondrateva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IrinaKondrateva/subscriptions","organizations_url":"https://api.github.com/users/IrinaKondrateva/orgs","repos_url":"https://api.github.com/users/IrinaKondrateva/repos","events_url":"https://api.github.com/users/IrinaKondrateva/events{/privacy}","received_events_url":"https://api.github.com/users/IrinaKondrateva/received_events","type":"User","site_admin":false},"body":"Удалено лишнее условие.","created_at":"2018-05-10T20:58:12Z","updated_at":"2018-05-10T20:58:13Z","html_url":"https://github.com/IrinaKondrateva/LSchoolHomeworkJS/pull/3#discussion_r187458303","pull_request_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/pulls/3","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/pulls/comments/187458303"},"html":{"href":"https://github.com/IrinaKondrateva/LSchoolHomeworkJS/pull/3#discussion_r187458303"},"pull_request":{"href":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/pulls/3"}},"in_reply_to_id":186706945},"pull_request":{"url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/pulls/3","id":186273712,"html_url":"https://github.com/IrinaKondrateva/LSchoolHomeworkJS/pull/3","diff_url":"https://github.com/IrinaKondrateva/LSchoolHomeworkJS/pull/3.diff","patch_url":"https://github.com/IrinaKondrateva/LSchoolHomeworkJS/pull/3.patch","issue_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/issues/3","number":3,"state":"open","locked":false,"title":"третье дз","user":{"login":"IrinaKondrateva","id":35540115,"avatar_url":"https://avatars3.githubusercontent.com/u/35540115?v=4","gravatar_id":"","url":"https://api.github.com/users/IrinaKondrateva","html_url":"https://github.com/IrinaKondrateva","followers_url":"https://api.github.com/users/IrinaKondrateva/followers","following_url":"https://api.github.com/users/IrinaKondrateva/following{/other_user}","gists_url":"https://api.github.com/users/IrinaKondrateva/gists{/gist_id}","starred_url":"https://api.github.com/users/IrinaKondrateva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IrinaKondrateva/subscriptions","organizations_url":"https://api.github.com/users/IrinaKondrateva/orgs","repos_url":"https://api.github.com/users/IrinaKondrateva/repos","events_url":"https://api.github.com/users/IrinaKondrateva/events{/privacy}","received_events_url":"https://api.github.com/users/IrinaKondrateva/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-05-07T07:19:48Z","updated_at":"2018-05-10T20:58:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f09b84e1e92cd9bdfa1e2ad6438af0884184b3e0","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/pulls/3/commits","review_comments_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/pulls/3/comments","review_comment_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/issues/3/comments","statuses_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/statuses/da4c1053fc8ba8c13b0daa7057dcd76d7a0508c5","head":{"label":"IrinaKondrateva:dz-week2.2","ref":"dz-week2.2","sha":"da4c1053fc8ba8c13b0daa7057dcd76d7a0508c5","user":{"login":"IrinaKondrateva","id":35540115,"avatar_url":"https://avatars3.githubusercontent.com/u/35540115?v=4","gravatar_id":"","url":"https://api.github.com/users/IrinaKondrateva","html_url":"https://github.com/IrinaKondrateva","followers_url":"https://api.github.com/users/IrinaKondrateva/followers","following_url":"https://api.github.com/users/IrinaKondrateva/following{/other_user}","gists_url":"https://api.github.com/users/IrinaKondrateva/gists{/gist_id}","starred_url":"https://api.github.com/users/IrinaKondrateva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IrinaKondrateva/subscriptions","organizations_url":"https://api.github.com/users/IrinaKondrateva/orgs","repos_url":"https://api.github.com/users/IrinaKondrateva/repos","events_url":"https://api.github.com/users/IrinaKondrateva/events{/privacy}","received_events_url":"https://api.github.com/users/IrinaKondrateva/received_events","type":"User","site_admin":false},"repo":{"id":131280320,"name":"LSchoolHomeworkJS","full_name":"IrinaKondrateva/LSchoolHomeworkJS","owner":{"login":"IrinaKondrateva","id":35540115,"avatar_url":"https://avatars3.githubusercontent.com/u/35540115?v=4","gravatar_id":"","url":"https://api.github.com/users/IrinaKondrateva","html_url":"https://github.com/IrinaKondrateva","followers_url":"https://api.github.com/users/IrinaKondrateva/followers","following_url":"https://api.github.com/users/IrinaKondrateva/following{/other_user}","gists_url":"https://api.github.com/users/IrinaKondrateva/gists{/gist_id}","starred_url":"https://api.github.com/users/IrinaKondrateva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IrinaKondrateva/subscriptions","organizations_url":"https://api.github.com/users/IrinaKondrateva/orgs","repos_url":"https://api.github.com/users/IrinaKondrateva/repos","events_url":"https://api.github.com/users/IrinaKondrateva/events{/privacy}","received_events_url":"https://api.github.com/users/IrinaKondrateva/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/IrinaKondrateva/LSchoolHomeworkJS","description":null,"fork":false,"url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS","forks_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/forks","keys_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/teams","hooks_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/hooks","issue_events_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/issues/events{/number}","events_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/events","assignees_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/assignees{/user}","branches_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/branches{/branch}","tags_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/tags","blobs_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/git/refs{/sha}","trees_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/statuses/{sha}","languages_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/languages","stargazers_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/stargazers","contributors_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/contributors","subscribers_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/subscribers","subscription_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/subscription","commits_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/commits{/sha}","git_commits_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/git/commits{/sha}","comments_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/comments{/number}","issue_comment_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/issues/comments{/number}","contents_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/contents/{+path}","compare_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/merges","archive_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/downloads","issues_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/issues{/number}","pulls_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/pulls{/number}","milestones_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/milestones{/number}","notifications_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/labels{/name}","releases_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/releases{/id}","deployments_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/deployments","created_at":"2018-04-27T10:09:38Z","updated_at":"2018-04-27T10:24:12Z","pushed_at":"2018-05-10T20:56:54Z","git_url":"git://github.com/IrinaKondrateva/LSchoolHomeworkJS.git","ssh_url":"git@github.com:IrinaKondrateva/LSchoolHomeworkJS.git","clone_url":"https://github.com/IrinaKondrateva/LSchoolHomeworkJS.git","svn_url":"https://github.com/IrinaKondrateva/LSchoolHomeworkJS","homepage":null,"size":245,"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,"archived":false,"open_issues_count":3,"license":null,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"IrinaKondrateva:master","ref":"master","sha":"82f99123913a61ecfa8d29091fee30b6ddce3f91","user":{"login":"IrinaKondrateva","id":35540115,"avatar_url":"https://avatars3.githubusercontent.com/u/35540115?v=4","gravatar_id":"","url":"https://api.github.com/users/IrinaKondrateva","html_url":"https://github.com/IrinaKondrateva","followers_url":"https://api.github.com/users/IrinaKondrateva/followers","following_url":"https://api.github.com/users/IrinaKondrateva/following{/other_user}","gists_url":"https://api.github.com/users/IrinaKondrateva/gists{/gist_id}","starred_url":"https://api.github.com/users/IrinaKondrateva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IrinaKondrateva/subscriptions","organizations_url":"https://api.github.com/users/IrinaKondrateva/orgs","repos_url":"https://api.github.com/users/IrinaKondrateva/repos","events_url":"https://api.github.com/users/IrinaKondrateva/events{/privacy}","received_events_url":"https://api.github.com/users/IrinaKondrateva/received_events","type":"User","site_admin":false},"repo":{"id":131280320,"name":"LSchoolHomeworkJS","full_name":"IrinaKondrateva/LSchoolHomeworkJS","owner":{"login":"IrinaKondrateva","id":35540115,"avatar_url":"https://avatars3.githubusercontent.com/u/35540115?v=4","gravatar_id":"","url":"https://api.github.com/users/IrinaKondrateva","html_url":"https://github.com/IrinaKondrateva","followers_url":"https://api.github.com/users/IrinaKondrateva/followers","following_url":"https://api.github.com/users/IrinaKondrateva/following{/other_user}","gists_url":"https://api.github.com/users/IrinaKondrateva/gists{/gist_id}","starred_url":"https://api.github.com/users/IrinaKondrateva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IrinaKondrateva/subscriptions","organizations_url":"https://api.github.com/users/IrinaKondrateva/orgs","repos_url":"https://api.github.com/users/IrinaKondrateva/repos","events_url":"https://api.github.com/users/IrinaKondrateva/events{/privacy}","received_events_url":"https://api.github.com/users/IrinaKondrateva/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/IrinaKondrateva/LSchoolHomeworkJS","description":null,"fork":false,"url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS","forks_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/forks","keys_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/teams","hooks_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/hooks","issue_events_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/issues/events{/number}","events_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/events","assignees_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/assignees{/user}","branches_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/branches{/branch}","tags_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/tags","blobs_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/git/refs{/sha}","trees_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/statuses/{sha}","languages_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/languages","stargazers_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/stargazers","contributors_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/contributors","subscribers_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/subscribers","subscription_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/subscription","commits_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/commits{/sha}","git_commits_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/git/commits{/sha}","comments_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/comments{/number}","issue_comment_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/issues/comments{/number}","contents_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/contents/{+path}","compare_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/merges","archive_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/downloads","issues_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/issues{/number}","pulls_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/pulls{/number}","milestones_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/milestones{/number}","notifications_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/labels{/name}","releases_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/releases{/id}","deployments_url":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/deployments","created_at":"2018-04-27T10:09:38Z","updated_at":"2018-04-27T10:24:12Z","pushed_at":"2018-05-10T20:56:54Z","git_url":"git://github.com/IrinaKondrateva/LSchoolHomeworkJS.git","ssh_url":"git@github.com:IrinaKondrateva/LSchoolHomeworkJS.git","clone_url":"https://github.com/IrinaKondrateva/LSchoolHomeworkJS.git","svn_url":"https://github.com/IrinaKondrateva/LSchoolHomeworkJS","homepage":null,"size":245,"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,"archived":false,"open_issues_count":3,"license":null,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/pulls/3"},"html":{"href":"https://github.com/IrinaKondrateva/LSchoolHomeworkJS/pull/3"},"issue":{"href":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/issues/3"},"comments":{"href":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/IrinaKondrateva/LSchoolHomeworkJS/statuses/da4c1053fc8ba8c13b0daa7057dcd76d7a0508c5"}},"author_association":"OWNER"}}
{"actor":{"display_login":"IrinaKondrateva"}}