payload: {"action":"created","comment":{"url":"https://api.github.com/repos/Alexandra08s/js/pulls/comments/289652458","pull_request_review_id":244636837,"id":289652458,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI4OTY1MjQ1OA==","diff_hunk":"@@ -0,0 +1,200 @@\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 'empty array';\n+    }\n+    \n+    if (typeof fn != 'function') {\n+        throw 'fn is not a function';\n+    }\n+    \n+    var array2=[], \n+        c = 0,\n+        result = 1;\n+\n+    for (var i = 0; i < array.length; i++) {\n+        if (fn(array[i]) == true) {\n+            array2[c] = 1;\n+            c++;\n+        } else {\n+            array2[c] = 0;\n+            c++;\n+        }\n+    }\n+    for (var item of array2) {\n+        result *= item;\n+    }\n+\n+    if (result == 1) {\n+        return true;\n+    }\n+     \n+    return false;\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 'empty array';\n+    }\n+\n+    if (typeof fn != 'function') {\n+        throw 'fn is not a function';\n+    }\n+\n+    var array2=[], \n+        c = 0,\n+        result = 0;\n+\n+    for (var i = 0; i < array.length; i++) {\n+        if (fn(array[i]) == true) {\n+            array2[c] = 1;\n+            c++;\n+        } else {\n+            array2[c] = 0;\n+            c++;\n+        }\n+    }\n+    for (var item of array2) {\n+        result += item;\n+    }\n+\n+    if (result > 0) {\n+        return true;\n+    }\n+  \n+    return false;\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+function returnBadArguments(fn) {\n+    var array = [...arguments].slice(1),\n+        array2 = [];\n+\n+    if (typeof fn != 'function') {\n+        throw 'fn is not a function'; \n+    }\n+\n+    for (var item of array) {\n+        try {\n+            fn(item)\n+        } catch (error) {\n+            array2.push(item);\n+        }\n+        \n+    }\n+\n+    return array2;\n+\n+}\n+\n+/*\n+ Задание 4:\n+\n+ 4.1: Функция имеет параметр number (по умолчанию - 0)\n+\n+ 4.2: Функция должна вернуть объект, у которого должно быть несколько методов:\n+   - sum - складывает number с переданными аргументами\n+   - dif - вычитает из number переданные аргументы\n+   - div - делит number на первый аргумент. Результат делится на следующий аргумент (если передан) и так далее\n+   - mul - умножает number на первый аргумент. Результат умножается на следующий аргумент (если передан) и так далее\n+\n+ Количество передаваемых в методы аргументов заранее неизвестно\n+\n+ 4.3: Необходимо выбрасывать исключение в случаях:\n+   - number не является числом (с текстом \"number is not a number\")\n+   - какой-либо из аргументов div является нулем (с текстом \"division by 0\")\n+ */\n+function calculator(number = 0) {\n+\n+    if (typeof number != 'number') {\n+        throw new Error('number is not a number');\n+    }\n+\n+    var obj = {\n+        sum: function () {\n+            for (let item of arguments) {\n+                number += item;\n+            }\n+            \n+            return number;\n+        },\n+        dif: function () {\n+            for (let item of arguments) {","path":"src/index.js","position":165,"original_position":165,"commit_id":"7560f7b0d8f5ba0daf1fefdd95ea7cbc740c9ff2","original_commit_id":"7560f7b0d8f5ba0daf1fefdd95ea7cbc740c9ff2","user":{"login":"shmel115","id":18418604,"node_id":"MDQ6VXNlcjE4NDE4NjA0","avatar_url":"https://avatars0.githubusercontent.com/u/18418604?v=4","gravatar_id":"","url":"https://api.github.com/users/shmel115","html_url":"https://github.com/shmel115","followers_url":"https://api.github.com/users/shmel115/followers","following_url":"https://api.github.com/users/shmel115/following{/other_user}","gists_url":"https://api.github.com/users/shmel115/gists{/gist_id}","starred_url":"https://api.github.com/users/shmel115/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shmel115/subscriptions","organizations_url":"https://api.github.com/users/shmel115/orgs","repos_url":"https://api.github.com/users/shmel115/repos","events_url":"https://api.github.com/users/shmel115/events{/privacy}","received_events_url":"https://api.github.com/users/shmel115/received_events","type":"User","site_admin":false},"body":"Домашка зачтена но лучше сделать через reduce теперь ведь ты знаешь его ","created_at":"2019-06-02T18:15:03Z","updated_at":"2019-06-02T18:15:14Z","html_url":"https://github.com/Alexandra08s/js/pull/3#discussion_r289652458","pull_request_url":"https://api.github.com/repos/Alexandra08s/js/pulls/3","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/Alexandra08s/js/pulls/comments/289652458"},"html":{"href":"https://github.com/Alexandra08s/js/pull/3#discussion_r289652458"},"pull_request":{"href":"https://api.github.com/repos/Alexandra08s/js/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/Alexandra08s/js/pulls/3","id":284350129,"node_id":"MDExOlB1bGxSZXF1ZXN0Mjg0MzUwMTI5","html_url":"https://github.com/Alexandra08s/js/pull/3","diff_url":"https://github.com/Alexandra08s/js/pull/3.diff","patch_url":"https://github.com/Alexandra08s/js/pull/3.patch","issue_url":"https://api.github.com/repos/Alexandra08s/js/issues/3","number":3,"state":"open","locked":false,"title":"Homework 3","user":{"login":"Alexandra08s","id":42070193,"node_id":"MDQ6VXNlcjQyMDcwMTkz","avatar_url":"https://avatars3.githubusercontent.com/u/42070193?v=4","gravatar_id":"","url":"https://api.github.com/users/Alexandra08s","html_url":"https://github.com/Alexandra08s","followers_url":"https://api.github.com/users/Alexandra08s/followers","following_url":"https://api.github.com/users/Alexandra08s/following{/other_user}","gists_url":"https://api.github.com/users/Alexandra08s/gists{/gist_id}","starred_url":"https://api.github.com/users/Alexandra08s/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Alexandra08s/subscriptions","organizations_url":"https://api.github.com/users/Alexandra08s/orgs","repos_url":"https://api.github.com/users/Alexandra08s/repos","events_url":"https://api.github.com/users/Alexandra08s/events{/privacy}","received_events_url":"https://api.github.com/users/Alexandra08s/received_events","type":"User","site_admin":false},"body":"","created_at":"2019-06-02T15:24:55Z","updated_at":"2019-06-02T18:15:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5ac1ab05762c06acf172f5cab3c2c281d2be4eb5","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Alexandra08s/js/pulls/3/commits","review_comments_url":"https://api.github.com/repos/Alexandra08s/js/pulls/3/comments","review_comment_url":"https://api.github.com/repos/Alexandra08s/js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Alexandra08s/js/issues/3/comments","statuses_url":"https://api.github.com/repos/Alexandra08s/js/statuses/7560f7b0d8f5ba0daf1fefdd95ea7cbc740c9ff2","head":{"label":"Alexandra08s:homework_3","ref":"homework_3","sha":"7560f7b0d8f5ba0daf1fefdd95ea7cbc740c9ff2","user":{"login":"Alexandra08s","id":42070193,"node_id":"MDQ6VXNlcjQyMDcwMTkz","avatar_url":"https://avatars3.githubusercontent.com/u/42070193?v=4","gravatar_id":"","url":"https://api.github.com/users/Alexandra08s","html_url":"https://github.com/Alexandra08s","followers_url":"https://api.github.com/users/Alexandra08s/followers","following_url":"https://api.github.com/users/Alexandra08s/following{/other_user}","gists_url":"https://api.github.com/users/Alexandra08s/gists{/gist_id}","starred_url":"https://api.github.com/users/Alexandra08s/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Alexandra08s/subscriptions","organizations_url":"https://api.github.com/users/Alexandra08s/orgs","repos_url":"https://api.github.com/users/Alexandra08s/repos","events_url":"https://api.github.com/users/Alexandra08s/events{/privacy}","received_events_url":"https://api.github.com/users/Alexandra08s/received_events","type":"User","site_admin":false},"repo":{"id":188060659,"node_id":"MDEwOlJlcG9zaXRvcnkxODgwNjA2NTk=","name":"js","full_name":"Alexandra08s/js","private":false,"owner":{"login":"Alexandra08s","id":42070193,"node_id":"MDQ6VXNlcjQyMDcwMTkz","avatar_url":"https://avatars3.githubusercontent.com/u/42070193?v=4","gravatar_id":"","url":"https://api.github.com/users/Alexandra08s","html_url":"https://github.com/Alexandra08s","followers_url":"https://api.github.com/users/Alexandra08s/followers","following_url":"https://api.github.com/users/Alexandra08s/following{/other_user}","gists_url":"https://api.github.com/users/Alexandra08s/gists{/gist_id}","starred_url":"https://api.github.com/users/Alexandra08s/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Alexandra08s/subscriptions","organizations_url":"https://api.github.com/users/Alexandra08s/orgs","repos_url":"https://api.github.com/users/Alexandra08s/repos","events_url":"https://api.github.com/users/Alexandra08s/events{/privacy}","received_events_url":"https://api.github.com/users/Alexandra08s/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Alexandra08s/js","description":null,"fork":false,"url":"https://api.github.com/repos/Alexandra08s/js","forks_url":"https://api.github.com/repos/Alexandra08s/js/forks","keys_url":"https://api.github.com/repos/Alexandra08s/js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Alexandra08s/js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Alexandra08s/js/teams","hooks_url":"https://api.github.com/repos/Alexandra08s/js/hooks","issue_events_url":"https://api.github.com/repos/Alexandra08s/js/issues/events{/number}","events_url":"https://api.github.com/repos/Alexandra08s/js/events","assignees_url":"https://api.github.com/repos/Alexandra08s/js/assignees{/user}","branches_url":"https://api.github.com/repos/Alexandra08s/js/branches{/branch}","tags_url":"https://api.github.com/repos/Alexandra08s/js/tags","blobs_url":"https://api.github.com/repos/Alexandra08s/js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Alexandra08s/js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Alexandra08s/js/git/refs{/sha}","trees_url":"https://api.github.com/repos/Alexandra08s/js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Alexandra08s/js/statuses/{sha}","languages_url":"https://api.github.com/repos/Alexandra08s/js/languages","stargazers_url":"https://api.github.com/repos/Alexandra08s/js/stargazers","contributors_url":"https://api.github.com/repos/Alexandra08s/js/contributors","subscribers_url":"https://api.github.com/repos/Alexandra08s/js/subscribers","subscription_url":"https://api.github.com/repos/Alexandra08s/js/subscription","commits_url":"https://api.github.com/repos/Alexandra08s/js/commits{/sha}","git_commits_url":"https://api.github.com/repos/Alexandra08s/js/git/commits{/sha}","comments_url":"https://api.github.com/repos/Alexandra08s/js/comments{/number}","issue_comment_url":"https://api.github.com/repos/Alexandra08s/js/issues/comments{/number}","contents_url":"https://api.github.com/repos/Alexandra08s/js/contents/{+path}","compare_url":"https://api.github.com/repos/Alexandra08s/js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Alexandra08s/js/merges","archive_url":"https://api.github.com/repos/Alexandra08s/js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Alexandra08s/js/downloads","issues_url":"https://api.github.com/repos/Alexandra08s/js/issues{/number}","pulls_url":"https://api.github.com/repos/Alexandra08s/js/pulls{/number}","milestones_url":"https://api.github.com/repos/Alexandra08s/js/milestones{/number}","notifications_url":"https://api.github.com/repos/Alexandra08s/js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Alexandra08s/js/labels{/name}","releases_url":"https://api.github.com/repos/Alexandra08s/js/releases{/id}","deployments_url":"https://api.github.com/repos/Alexandra08s/js/deployments","created_at":"2019-05-22T14:57:40Z","updated_at":"2019-05-23T09:00:37Z","pushed_at":"2019-06-02T15:24:56Z","git_url":"git://github.com/Alexandra08s/js.git","ssh_url":"git@github.com:Alexandra08s/js.git","clone_url":"https://github.com/Alexandra08s/js.git","svn_url":"https://github.com/Alexandra08s/js","homepage":null,"size":98,"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,"disabled":false,"open_issues_count":3,"license":null,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"Alexandra08s:master","ref":"master","sha":"97f6d70efc4e73548c9ee2ea536c98e82670feff","user":{"login":"Alexandra08s","id":42070193,"node_id":"MDQ6VXNlcjQyMDcwMTkz","avatar_url":"https://avatars3.githubusercontent.com/u/42070193?v=4","gravatar_id":"","url":"https://api.github.com/users/Alexandra08s","html_url":"https://github.com/Alexandra08s","followers_url":"https://api.github.com/users/Alexandra08s/followers","following_url":"https://api.github.com/users/Alexandra08s/following{/other_user}","gists_url":"https://api.github.com/users/Alexandra08s/gists{/gist_id}","starred_url":"https://api.github.com/users/Alexandra08s/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Alexandra08s/subscriptions","organizations_url":"https://api.github.com/users/Alexandra08s/orgs","repos_url":"https://api.github.com/users/Alexandra08s/repos","events_url":"https://api.github.com/users/Alexandra08s/events{/privacy}","received_events_url":"https://api.github.com/users/Alexandra08s/received_events","type":"User","site_admin":false},"repo":{"id":188060659,"node_id":"MDEwOlJlcG9zaXRvcnkxODgwNjA2NTk=","name":"js","full_name":"Alexandra08s/js","private":false,"owner":{"login":"Alexandra08s","id":42070193,"node_id":"MDQ6VXNlcjQyMDcwMTkz","avatar_url":"https://avatars3.githubusercontent.com/u/42070193?v=4","gravatar_id":"","url":"https://api.github.com/users/Alexandra08s","html_url":"https://github.com/Alexandra08s","followers_url":"https://api.github.com/users/Alexandra08s/followers","following_url":"https://api.github.com/users/Alexandra08s/following{/other_user}","gists_url":"https://api.github.com/users/Alexandra08s/gists{/gist_id}","starred_url":"https://api.github.com/users/Alexandra08s/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Alexandra08s/subscriptions","organizations_url":"https://api.github.com/users/Alexandra08s/orgs","repos_url":"https://api.github.com/users/Alexandra08s/repos","events_url":"https://api.github.com/users/Alexandra08s/events{/privacy}","received_events_url":"https://api.github.com/users/Alexandra08s/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Alexandra08s/js","description":null,"fork":false,"url":"https://api.github.com/repos/Alexandra08s/js","forks_url":"https://api.github.com/repos/Alexandra08s/js/forks","keys_url":"https://api.github.com/repos/Alexandra08s/js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Alexandra08s/js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Alexandra08s/js/teams","hooks_url":"https://api.github.com/repos/Alexandra08s/js/hooks","issue_events_url":"https://api.github.com/repos/Alexandra08s/js/issues/events{/number}","events_url":"https://api.github.com/repos/Alexandra08s/js/events","assignees_url":"https://api.github.com/repos/Alexandra08s/js/assignees{/user}","branches_url":"https://api.github.com/repos/Alexandra08s/js/branches{/branch}","tags_url":"https://api.github.com/repos/Alexandra08s/js/tags","blobs_url":"https://api.github.com/repos/Alexandra08s/js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Alexandra08s/js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Alexandra08s/js/git/refs{/sha}","trees_url":"https://api.github.com/repos/Alexandra08s/js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Alexandra08s/js/statuses/{sha}","languages_url":"https://api.github.com/repos/Alexandra08s/js/languages","stargazers_url":"https://api.github.com/repos/Alexandra08s/js/stargazers","contributors_url":"https://api.github.com/repos/Alexandra08s/js/contributors","subscribers_url":"https://api.github.com/repos/Alexandra08s/js/subscribers","subscription_url":"https://api.github.com/repos/Alexandra08s/js/subscription","commits_url":"https://api.github.com/repos/Alexandra08s/js/commits{/sha}","git_commits_url":"https://api.github.com/repos/Alexandra08s/js/git/commits{/sha}","comments_url":"https://api.github.com/repos/Alexandra08s/js/comments{/number}","issue_comment_url":"https://api.github.com/repos/Alexandra08s/js/issues/comments{/number}","contents_url":"https://api.github.com/repos/Alexandra08s/js/contents/{+path}","compare_url":"https://api.github.com/repos/Alexandra08s/js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Alexandra08s/js/merges","archive_url":"https://api.github.com/repos/Alexandra08s/js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Alexandra08s/js/downloads","issues_url":"https://api.github.com/repos/Alexandra08s/js/issues{/number}","pulls_url":"https://api.github.com/repos/Alexandra08s/js/pulls{/number}","milestones_url":"https://api.github.com/repos/Alexandra08s/js/milestones{/number}","notifications_url":"https://api.github.com/repos/Alexandra08s/js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Alexandra08s/js/labels{/name}","releases_url":"https://api.github.com/repos/Alexandra08s/js/releases{/id}","deployments_url":"https://api.github.com/repos/Alexandra08s/js/deployments","created_at":"2019-05-22T14:57:40Z","updated_at":"2019-05-23T09:00:37Z","pushed_at":"2019-06-02T15:24:56Z","git_url":"git://github.com/Alexandra08s/js.git","ssh_url":"git@github.com:Alexandra08s/js.git","clone_url":"https://github.com/Alexandra08s/js.git","svn_url":"https://github.com/Alexandra08s/js","homepage":null,"size":98,"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,"disabled":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/Alexandra08s/js/pulls/3"},"html":{"href":"https://github.com/Alexandra08s/js/pull/3"},"issue":{"href":"https://api.github.com/repos/Alexandra08s/js/issues/3"},"comments":{"href":"https://api.github.com/repos/Alexandra08s/js/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/Alexandra08s/js/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/Alexandra08s/js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Alexandra08s/js/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/Alexandra08s/js/statuses/7560f7b0d8f5ba0daf1fefdd95ea7cbc740c9ff2"}},"author_association":"OWNER"}}
other: {"actor":{"display_login":"shmel115"}}