{"action":"created","comment":{"url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/pulls/comments/46514333","id":46514333,"diff_hunk":"@@ -1,21 +1,175 @@\n 'use strict';\n \n var Collection = function () {\n+    this.array = [];\n+    this.first = null;\n+    this.last = null;\n+    this.length = 0;\n+    this.isEmpty = true;\n+};\n+Collection.prototype.pickFirst = function () {\n+    if (!this.isEmpty) {\n+        var res = this.array.shift();\n+        this.length--;\n+        if (this.length === 0) {\n+            this.isEmpty = true;\n+        } else {\n+            this.isEmpty = false;\n+        }\n+        if (!this.isEmpty) {\n+            this.first = this.array[0];\n+            this.last = this.array[this.length - 1];\n+        }\n+        return res;\n+    }\n+    return 'Коллекция пуста';\n+};\n+\n+Collection.prototype.pickLast = function () {\n+    if (!this.isEmpty) {\n+        var res = this.array.pop();\n+        this.length--;\n+        if (this.length === 0) {\n+            this.isEmpty = true;\n+        } else {\n+            this.isEmpty = false;\n+        }\n+        if (!this.isEmpty) {\n+            this.first = this.array[0];\n+            this.last = this.array[this.length - 1];\n+        }\n+        return res;\n+    }\n+    return 'Коллекция пуста';\n+};\n+\n+Collection.prototype.insertFirst = function (elem) {\n+    this.array.unshift(elem);\n+    this.first = elem;\n+    this.length++;\n+    this.last = this.array[this.length - 1];\n+    this.isEmpty = false;\n+};\n+\n+Collection.prototype.insertLast = function (elem) {\n+    this.last = elem;\n+    this.array.push(elem);\n+    this.length++;\n+    this.first = this.array[0];\n+    this.isEmpty = false;\n+\n+};\n \n+Collection.prototype.empty = function () {\n+    this.isEmpty = true;\n+    this.first = null;\n+    this.last = null;\n+    this.array = [];\n+    this.length = 0;\n };\n \n var Queue = function () {\n+    this.array = [];\n+    this.length = 0;\n+};\n+\n+Queue.prototype = Object.create(Collection.prototype);\n+\n+Queue.prototype.enqueue = function (item) {\n+    this.insertFirst(item);\n+};\n+\n+Queue.prototype.dequeue = function () {\n+    return this.pickLast();\n+};\n \n+Queue.prototype.empty = function () {\n+    this.empty();\n };\n \n var FixedArray = function (size) {\n+    this.array = [];\n+    this.length = size;\n+};\n \n+FixedArray.prototype.insertAt = function (index, item) {\n+    if (index > this.length - 1 || index < 0) {\n+        throw new RangeError('Индекс больше' + this.length + 'или меньше 0');\n+    }\n+    this.array[index] = item;\n };\n \n+FixedArray.prototype.getAt = function (index) {\n+    if (index > this.length - 1 || index < 0) {\n+        throw new RangeError('Индекс больше' + this.length + 'или меньше 0');\n+    }\n+    return this.array[index];\n+};\n+\n+\n var Set = function () {\n+    this.length = 0;\n+    this.array = [];\n+};\n+\n+Set.prototype = Object.create(Collection.prototype);\n+\n+Set.prototype.insert = function (item) {\n+    if (!this.has(item)) {\n+        this.insertFirst(item);\n+    }\n+};\n+\n+Set.prototype.remove = function (item) {\n+    var deletItem = this.array.indexOf(item);\n+    if (deletItem === -1) {\n+        return 'элемент отсутствует';\n+    } else {\n+        this.array.splice(deletItem, 1);\n+        this.length--;\n+    }\n+};\n+Set.prototype.has = function (item) {\n+\n+    var validFind = new RegExp(item,'i');\n+    if (!validFind.exec(this.array)) {","path":"src/standard-library.js","position":135,"original_position":135,"commit_id":"6393e4e083810cbdb623fe3684178de5baaca5a5","original_commit_id":"6393e4e083810cbdb623fe3684178de5baaca5a5","user":{"login":"maxvipon","id":871596,"avatar_url":"https://avatars.githubusercontent.com/u/871596?v=3","gravatar_id":"","url":"https://api.github.com/users/maxvipon","html_url":"https://github.com/maxvipon","followers_url":"https://api.github.com/users/maxvipon/followers","following_url":"https://api.github.com/users/maxvipon/following{/other_user}","gists_url":"https://api.github.com/users/maxvipon/gists{/gist_id}","starred_url":"https://api.github.com/users/maxvipon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxvipon/subscriptions","organizations_url":"https://api.github.com/users/maxvipon/orgs","repos_url":"https://api.github.com/users/maxvipon/repos","events_url":"https://api.github.com/users/maxvipon/events{/privacy}","received_events_url":"https://api.github.com/users/maxvipon/received_events","type":"User","site_admin":false},"body":"`O_O`\r\nОбъясни сие решение?","created_at":"2015-12-03T05:38:18Z","updated_at":"2015-12-03T05:38:18Z","html_url":"https://github.com/urfu-2015/javascript-tasks-8/pull/33#discussion_r46514333","pull_request_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/pulls/33","_links":{"self":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/pulls/comments/46514333"},"html":{"href":"https://github.com/urfu-2015/javascript-tasks-8/pull/33#discussion_r46514333"},"pull_request":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/pulls/33"}}},"pull_request":{"url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/pulls/33","id":51578096,"html_url":"https://github.com/urfu-2015/javascript-tasks-8/pull/33","diff_url":"https://github.com/urfu-2015/javascript-tasks-8/pull/33.diff","patch_url":"https://github.com/urfu-2015/javascript-tasks-8/pull/33.patch","issue_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/issues/33","number":33,"state":"open","locked":false,"title":"Хмелев Дмитрий","user":{"login":"NeSmogPridymatNick","id":14878311,"avatar_url":"https://avatars.githubusercontent.com/u/14878311?v=3","gravatar_id":"","url":"https://api.github.com/users/NeSmogPridymatNick","html_url":"https://github.com/NeSmogPridymatNick","followers_url":"https://api.github.com/users/NeSmogPridymatNick/followers","following_url":"https://api.github.com/users/NeSmogPridymatNick/following{/other_user}","gists_url":"https://api.github.com/users/NeSmogPridymatNick/gists{/gist_id}","starred_url":"https://api.github.com/users/NeSmogPridymatNick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NeSmogPridymatNick/subscriptions","organizations_url":"https://api.github.com/users/NeSmogPridymatNick/orgs","repos_url":"https://api.github.com/users/NeSmogPridymatNick/repos","events_url":"https://api.github.com/users/NeSmogPridymatNick/events{/privacy}","received_events_url":"https://api.github.com/users/NeSmogPridymatNick/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-23T20:50:15Z","updated_at":"2015-12-03T05:38:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7eb7f3621e5b4de68dbb1882938df0174df1bd03","assignee":{"login":"maxvipon","id":871596,"avatar_url":"https://avatars.githubusercontent.com/u/871596?v=3","gravatar_id":"","url":"https://api.github.com/users/maxvipon","html_url":"https://github.com/maxvipon","followers_url":"https://api.github.com/users/maxvipon/followers","following_url":"https://api.github.com/users/maxvipon/following{/other_user}","gists_url":"https://api.github.com/users/maxvipon/gists{/gist_id}","starred_url":"https://api.github.com/users/maxvipon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxvipon/subscriptions","organizations_url":"https://api.github.com/users/maxvipon/orgs","repos_url":"https://api.github.com/users/maxvipon/repos","events_url":"https://api.github.com/users/maxvipon/events{/privacy}","received_events_url":"https://api.github.com/users/maxvipon/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/pulls/33/commits","review_comments_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/pulls/33/comments","review_comment_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/pulls/comments{/number}","comments_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/issues/33/comments","statuses_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/statuses/6393e4e083810cbdb623fe3684178de5baaca5a5","head":{"label":"NeSmogPridymatNick:master","ref":"master","sha":"6393e4e083810cbdb623fe3684178de5baaca5a5","user":{"login":"NeSmogPridymatNick","id":14878311,"avatar_url":"https://avatars.githubusercontent.com/u/14878311?v=3","gravatar_id":"","url":"https://api.github.com/users/NeSmogPridymatNick","html_url":"https://github.com/NeSmogPridymatNick","followers_url":"https://api.github.com/users/NeSmogPridymatNick/followers","following_url":"https://api.github.com/users/NeSmogPridymatNick/following{/other_user}","gists_url":"https://api.github.com/users/NeSmogPridymatNick/gists{/gist_id}","starred_url":"https://api.github.com/users/NeSmogPridymatNick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NeSmogPridymatNick/subscriptions","organizations_url":"https://api.github.com/users/NeSmogPridymatNick/orgs","repos_url":"https://api.github.com/users/NeSmogPridymatNick/repos","events_url":"https://api.github.com/users/NeSmogPridymatNick/events{/privacy}","received_events_url":"https://api.github.com/users/NeSmogPridymatNick/received_events","type":"User","site_admin":false},"repo":{"id":46670130,"name":"javascript-tasks-8","full_name":"NeSmogPridymatNick/javascript-tasks-8","owner":{"login":"NeSmogPridymatNick","id":14878311,"avatar_url":"https://avatars.githubusercontent.com/u/14878311?v=3","gravatar_id":"","url":"https://api.github.com/users/NeSmogPridymatNick","html_url":"https://github.com/NeSmogPridymatNick","followers_url":"https://api.github.com/users/NeSmogPridymatNick/followers","following_url":"https://api.github.com/users/NeSmogPridymatNick/following{/other_user}","gists_url":"https://api.github.com/users/NeSmogPridymatNick/gists{/gist_id}","starred_url":"https://api.github.com/users/NeSmogPridymatNick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NeSmogPridymatNick/subscriptions","organizations_url":"https://api.github.com/users/NeSmogPridymatNick/orgs","repos_url":"https://api.github.com/users/NeSmogPridymatNick/repos","events_url":"https://api.github.com/users/NeSmogPridymatNick/events{/privacy}","received_events_url":"https://api.github.com/users/NeSmogPridymatNick/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/NeSmogPridymatNick/javascript-tasks-8","description":"Задание №8: Стандартная библиотека","fork":true,"url":"https://api.github.com/repos/NeSmogPridymatNick/javascript-tasks-8","forks_url":"https://api.github.com/repos/NeSmogPridymatNick/javascript-tasks-8/forks","keys_url":"https://api.github.com/repos/NeSmogPridymatNick/javascript-tasks-8/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NeSmogPridymatNick/javascript-tasks-8/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NeSmogPridymatNick/javascript-tasks-8/teams","hooks_url":"https://api.github.com/repos/NeSmogPridymatNick/javascript-tasks-8/hooks","issue_events_url":"https://api.github.com/repos/NeSmogPridymatNick/javascript-tasks-8/issues/events{/number}","events_url":"https://api.github.com/repos/NeSmogPridymatNick/javascript-tasks-8/events","assignees_url":"https://api.github.com/repos/NeSmogPridymatNick/javascript-tasks-8/assignees{/user}","branches_url":"https://api.github.com/repos/NeSmogPridymatNick/javascript-tasks-8/branches{/branch}","tags_url":"https://api.github.com/repos/NeSmogPridymatNick/javascript-tasks-8/tags","blobs_url":"https://api.github.com/repos/NeSmogPridymatNick/javascript-tasks-8/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NeSmogPridymatNick/javascript-tasks-8/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NeSmogPridymatNick/javascript-tasks-8/git/refs{/sha}","trees_url":"https://api.github.com/repos/NeSmogPridymatNick/javascript-tasks-8/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NeSmogPridymatNick/javascript-tasks-8/statuses/{sha}","languages_url":"https://api.github.com/repos/NeSmogPridymatNick/javascript-tasks-8/languages","stargazers_url":"https://api.github.com/repos/NeSmogPridymatNick/javascript-tasks-8/stargazers","contributors_url":"https://api.github.com/repos/NeSmogPridymatNick/javascript-tasks-8/contributors","subscribers_url":"https://api.github.com/repos/NeSmogPridymatNick/javascript-tasks-8/subscribers","subscription_url":"https://api.github.com/repos/NeSmogPridymatNick/javascript-tasks-8/subscription","commits_url":"https://api.github.com/repos/NeSmogPridymatNick/javascript-tasks-8/commits{/sha}","git_commits_url":"https://api.github.com/repos/NeSmogPridymatNick/javascript-tasks-8/git/commits{/sha}","comments_url":"https://api.github.com/repos/NeSmogPridymatNick/javascript-tasks-8/comments{/number}","issue_comment_url":"https://api.github.com/repos/NeSmogPridymatNick/javascript-tasks-8/issues/comments{/number}","contents_url":"https://api.github.com/repos/NeSmogPridymatNick/javascript-tasks-8/contents/{+path}","compare_url":"https://api.github.com/repos/NeSmogPridymatNick/javascript-tasks-8/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NeSmogPridymatNick/javascript-tasks-8/merges","archive_url":"https://api.github.com/repos/NeSmogPridymatNick/javascript-tasks-8/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NeSmogPridymatNick/javascript-tasks-8/downloads","issues_url":"https://api.github.com/repos/NeSmogPridymatNick/javascript-tasks-8/issues{/number}","pulls_url":"https://api.github.com/repos/NeSmogPridymatNick/javascript-tasks-8/pulls{/number}","milestones_url":"https://api.github.com/repos/NeSmogPridymatNick/javascript-tasks-8/milestones{/number}","notifications_url":"https://api.github.com/repos/NeSmogPridymatNick/javascript-tasks-8/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NeSmogPridymatNick/javascript-tasks-8/labels{/name}","releases_url":"https://api.github.com/repos/NeSmogPridymatNick/javascript-tasks-8/releases{/id}","created_at":"2015-11-22T16:57:06Z","updated_at":"2015-11-22T16:57:07Z","pushed_at":"2015-11-23T20:49:25Z","git_url":"git://github.com/NeSmogPridymatNick/javascript-tasks-8.git","ssh_url":"git@github.com:NeSmogPridymatNick/javascript-tasks-8.git","clone_url":"https://github.com/NeSmogPridymatNick/javascript-tasks-8.git","svn_url":"https://github.com/NeSmogPridymatNick/javascript-tasks-8","homepage":"","size":7,"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":"136bb0f717d3c81d21e1d0832d229d734a4532ac","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":46341213,"name":"javascript-tasks-8","full_name":"urfu-2015/javascript-tasks-8","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-8","description":"Задание №8: Стандартная библиотека","fork":false,"url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8","forks_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/forks","keys_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/keys{/key_id}","collaborators_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/teams","hooks_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/hooks","issue_events_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/issues/events{/number}","events_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/events","assignees_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/assignees{/user}","branches_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/branches{/branch}","tags_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/tags","blobs_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/git/refs{/sha}","trees_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/git/trees{/sha}","statuses_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/statuses/{sha}","languages_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/languages","stargazers_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/stargazers","contributors_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/contributors","subscribers_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/subscribers","subscription_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/subscription","commits_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/commits{/sha}","git_commits_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/git/commits{/sha}","comments_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/comments{/number}","issue_comment_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/issues/comments{/number}","contents_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/contents/{+path}","compare_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/compare/{base}...{head}","merges_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/merges","archive_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/downloads","issues_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/issues{/number}","pulls_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/pulls{/number}","milestones_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/milestones{/number}","notifications_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/labels{/name}","releases_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/releases{/id}","created_at":"2015-11-17T10:57:38Z","updated_at":"2015-11-17T14:09:53Z","pushed_at":"2015-12-02T16:43:07Z","git_url":"git://github.com/urfu-2015/javascript-tasks-8.git","ssh_url":"git@github.com:urfu-2015/javascript-tasks-8.git","clone_url":"https://github.com/urfu-2015/javascript-tasks-8.git","svn_url":"https://github.com/urfu-2015/javascript-tasks-8","homepage":"","size":18,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":42,"mirror_url":null,"open_issues_count":15,"forks":42,"open_issues":15,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/pulls/33"},"html":{"href":"https://github.com/urfu-2015/javascript-tasks-8/pull/33"},"issue":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/issues/33"},"comments":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/issues/33/comments"},"review_comments":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/pulls/33/comments"},"review_comment":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/pulls/33/commits"},"statuses":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/statuses/6393e4e083810cbdb623fe3684178de5baaca5a5"}}}}