{"action":"created","comment":{"url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/pulls/comments/46093384","id":46093384,"diff_hunk":"@@ -1,32 +1,138 @@\n 'use strict';\n \n var Collection = function () {\n+    this.first = undefined;\n+    this.last = undefined;\n+    this.container = [];\n+    this.length = 0;\n+    this.isEmpty = true;\n+};\n+Collection.prototype.pickFirst = function () {\n+    this.length--;\n+    this.isEmpty = this.container.length === 0;\n+    this.first = this.container[1];\n+    this.last = this.container[this.container.length - 1];\n+    return (this.container.splice(0, 1))[0];\n+};\n+Collection.prototype.pickLast = function () {\n+    this.length--;\n+    this.isEmpty = this.container.length === 0;\n+    this.first = this.container[0];\n+    this.last = this.container[this.container.length - 2];\n+    return (this.container.splice(-1, 1))[0];\n+};\n+Collection.prototype.insertFirst = function (obj) {\n+    this.length++;\n+    this.isEmpty = this.container.length === 0;\n+    this.container.splice(0, 0, obj);\n+    this.last = this.container[this.container.length - 1];\n+    this.first = this.container[0];\n+};\n+Collection.prototype.insertLast = function (obj) {\n+    this.length++;\n+    this.isEmpty = this.container.length === 0;\n+    this.container.splice(this.container.length, 0, obj);","path":"src/standard-library.js","position":34,"original_position":34,"commit_id":"79b4719804c8d7dcf7ca00eee397c0b333ca8bfd","original_commit_id":"79b4719804c8d7dcf7ca00eee397c0b333ca8bfd","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":"Есть метод `push()` для массивов, который как раз для этого","created_at":"2015-11-29T15:11:30Z","updated_at":"2015-11-29T15:11:30Z","html_url":"https://github.com/urfu-2015/javascript-tasks-8/pull/27#discussion_r46093384","pull_request_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/pulls/27","_links":{"self":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/pulls/comments/46093384"},"html":{"href":"https://github.com/urfu-2015/javascript-tasks-8/pull/27#discussion_r46093384"},"pull_request":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/pulls/27"}}},"pull_request":{"url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/pulls/27","id":51569527,"html_url":"https://github.com/urfu-2015/javascript-tasks-8/pull/27","diff_url":"https://github.com/urfu-2015/javascript-tasks-8/pull/27.diff","patch_url":"https://github.com/urfu-2015/javascript-tasks-8/pull/27.patch","issue_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/issues/27","number":27,"state":"open","locked":false,"title":"Долгих Наташа","user":{"login":"dolgihnatasha","id":6077501,"avatar_url":"https://avatars.githubusercontent.com/u/6077501?v=3","gravatar_id":"","url":"https://api.github.com/users/dolgihnatasha","html_url":"https://github.com/dolgihnatasha","followers_url":"https://api.github.com/users/dolgihnatasha/followers","following_url":"https://api.github.com/users/dolgihnatasha/following{/other_user}","gists_url":"https://api.github.com/users/dolgihnatasha/gists{/gist_id}","starred_url":"https://api.github.com/users/dolgihnatasha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dolgihnatasha/subscriptions","organizations_url":"https://api.github.com/users/dolgihnatasha/orgs","repos_url":"https://api.github.com/users/dolgihnatasha/repos","events_url":"https://api.github.com/users/dolgihnatasha/events{/privacy}","received_events_url":"https://api.github.com/users/dolgihnatasha/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-23T19:38:14Z","updated_at":"2015-11-29T15:11:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9a59b3d621dfe5744fe680abcccaa4996e3b87f5","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-8/pulls/27/commits","review_comments_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/pulls/27/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/27/comments","statuses_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/statuses/79b4719804c8d7dcf7ca00eee397c0b333ca8bfd","head":{"label":"dolgihnatasha:master","ref":"master","sha":"79b4719804c8d7dcf7ca00eee397c0b333ca8bfd","user":{"login":"dolgihnatasha","id":6077501,"avatar_url":"https://avatars.githubusercontent.com/u/6077501?v=3","gravatar_id":"","url":"https://api.github.com/users/dolgihnatasha","html_url":"https://github.com/dolgihnatasha","followers_url":"https://api.github.com/users/dolgihnatasha/followers","following_url":"https://api.github.com/users/dolgihnatasha/following{/other_user}","gists_url":"https://api.github.com/users/dolgihnatasha/gists{/gist_id}","starred_url":"https://api.github.com/users/dolgihnatasha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dolgihnatasha/subscriptions","organizations_url":"https://api.github.com/users/dolgihnatasha/orgs","repos_url":"https://api.github.com/users/dolgihnatasha/repos","events_url":"https://api.github.com/users/dolgihnatasha/events{/privacy}","received_events_url":"https://api.github.com/users/dolgihnatasha/received_events","type":"User","site_admin":false},"repo":{"id":46735278,"name":"javascript-tasks-8","full_name":"dolgihnatasha/javascript-tasks-8","owner":{"login":"dolgihnatasha","id":6077501,"avatar_url":"https://avatars.githubusercontent.com/u/6077501?v=3","gravatar_id":"","url":"https://api.github.com/users/dolgihnatasha","html_url":"https://github.com/dolgihnatasha","followers_url":"https://api.github.com/users/dolgihnatasha/followers","following_url":"https://api.github.com/users/dolgihnatasha/following{/other_user}","gists_url":"https://api.github.com/users/dolgihnatasha/gists{/gist_id}","starred_url":"https://api.github.com/users/dolgihnatasha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dolgihnatasha/subscriptions","organizations_url":"https://api.github.com/users/dolgihnatasha/orgs","repos_url":"https://api.github.com/users/dolgihnatasha/repos","events_url":"https://api.github.com/users/dolgihnatasha/events{/privacy}","received_events_url":"https://api.github.com/users/dolgihnatasha/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dolgihnatasha/javascript-tasks-8","description":"Задание №8: Стандартная библиотека","fork":true,"url":"https://api.github.com/repos/dolgihnatasha/javascript-tasks-8","forks_url":"https://api.github.com/repos/dolgihnatasha/javascript-tasks-8/forks","keys_url":"https://api.github.com/repos/dolgihnatasha/javascript-tasks-8/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dolgihnatasha/javascript-tasks-8/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dolgihnatasha/javascript-tasks-8/teams","hooks_url":"https://api.github.com/repos/dolgihnatasha/javascript-tasks-8/hooks","issue_events_url":"https://api.github.com/repos/dolgihnatasha/javascript-tasks-8/issues/events{/number}","events_url":"https://api.github.com/repos/dolgihnatasha/javascript-tasks-8/events","assignees_url":"https://api.github.com/repos/dolgihnatasha/javascript-tasks-8/assignees{/user}","branches_url":"https://api.github.com/repos/dolgihnatasha/javascript-tasks-8/branches{/branch}","tags_url":"https://api.github.com/repos/dolgihnatasha/javascript-tasks-8/tags","blobs_url":"https://api.github.com/repos/dolgihnatasha/javascript-tasks-8/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dolgihnatasha/javascript-tasks-8/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dolgihnatasha/javascript-tasks-8/git/refs{/sha}","trees_url":"https://api.github.com/repos/dolgihnatasha/javascript-tasks-8/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dolgihnatasha/javascript-tasks-8/statuses/{sha}","languages_url":"https://api.github.com/repos/dolgihnatasha/javascript-tasks-8/languages","stargazers_url":"https://api.github.com/repos/dolgihnatasha/javascript-tasks-8/stargazers","contributors_url":"https://api.github.com/repos/dolgihnatasha/javascript-tasks-8/contributors","subscribers_url":"https://api.github.com/repos/dolgihnatasha/javascript-tasks-8/subscribers","subscription_url":"https://api.github.com/repos/dolgihnatasha/javascript-tasks-8/subscription","commits_url":"https://api.github.com/repos/dolgihnatasha/javascript-tasks-8/commits{/sha}","git_commits_url":"https://api.github.com/repos/dolgihnatasha/javascript-tasks-8/git/commits{/sha}","comments_url":"https://api.github.com/repos/dolgihnatasha/javascript-tasks-8/comments{/number}","issue_comment_url":"https://api.github.com/repos/dolgihnatasha/javascript-tasks-8/issues/comments{/number}","contents_url":"https://api.github.com/repos/dolgihnatasha/javascript-tasks-8/contents/{+path}","compare_url":"https://api.github.com/repos/dolgihnatasha/javascript-tasks-8/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dolgihnatasha/javascript-tasks-8/merges","archive_url":"https://api.github.com/repos/dolgihnatasha/javascript-tasks-8/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dolgihnatasha/javascript-tasks-8/downloads","issues_url":"https://api.github.com/repos/dolgihnatasha/javascript-tasks-8/issues{/number}","pulls_url":"https://api.github.com/repos/dolgihnatasha/javascript-tasks-8/pulls{/number}","milestones_url":"https://api.github.com/repos/dolgihnatasha/javascript-tasks-8/milestones{/number}","notifications_url":"https://api.github.com/repos/dolgihnatasha/javascript-tasks-8/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dolgihnatasha/javascript-tasks-8/labels{/name}","releases_url":"https://api.github.com/repos/dolgihnatasha/javascript-tasks-8/releases{/id}","created_at":"2015-11-23T17:03:03Z","updated_at":"2015-11-23T17:03:04Z","pushed_at":"2015-11-24T15:09:49Z","git_url":"git://github.com/dolgihnatasha/javascript-tasks-8.git","ssh_url":"git@github.com:dolgihnatasha/javascript-tasks-8.git","clone_url":"https://github.com/dolgihnatasha/javascript-tasks-8.git","svn_url":"https://github.com/dolgihnatasha/javascript-tasks-8","homepage":"","size":12,"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-11-29T13:44:12Z","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":26,"forks":42,"open_issues":26,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/pulls/27"},"html":{"href":"https://github.com/urfu-2015/javascript-tasks-8/pull/27"},"issue":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/issues/27"},"comments":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/issues/27/comments"},"review_comments":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/pulls/27/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/27/commits"},"statuses":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-8/statuses/79b4719804c8d7dcf7ca00eee397c0b333ca8bfd"}}}}