{"action":"created","comment":{"url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/pulls/comments/42949091","id":42949091,"diff_hunk":"@@ -15,13 +18,172 @@ module.exports.reverse = function () {\n     };\n };\n \n-// Оператор limit, который выбирает первые N записей\n+module.exports.select = function () {\n+    var fields = [];\n+    for (var i = 0; i < arguments.length; i++) {\n+        fields[i] = arguments[i];\n+    }\n+    return function (collection) {\n+        var changedCollection = [];\n+        for (var i = 0; i < collection.length; i++) {\n+            var changedRecord = {};\n+            var record = collection[i];\n+            for (var j = 0; j < fields.length; j++) {\n+                changedRecord[fields[j]] = record[fields[j]];\n+            }\n+            changedCollection[i] = changedRecord;\n+        }\n+        return changedCollection;\n+    };\n+};\n+\n+module.exports.filterIn = function (field, values) {\n+    return function (collection) {\n+        var changedCollection = [];\n+        for (var i = 0; i < collection.length; i++) {\n+            var isMatching = false;\n+            for (var j = 0; j < values.length; j++) {\n+                if (collection[i][field] === values[j]) {\n+                    isMatching = true;\n+                    break;\n+                }\n+            }\n+            if (isMatching) {\n+                changedCollection.push(copyRecord(collection[i]));\n+            }\n+        }\n+        return changedCollection;\n+    };\n+};\n+\n+module.exports.filterEqual = function (field, value) {\n+    return function (collection) {\n+        var values = [];\n+        values.push(value);","path":"lego.js","position":63,"original_position":63,"commit_id":"5a8fb9c0d5906375b544b565db3a5ad153a5fac1","original_commit_id":"5a8fb9c0d5906375b544b565db3a5ad153a5fac1","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":"Да и сама переменная похоже не особо нужна","created_at":"2015-10-25T19:29:44Z","updated_at":"2015-10-25T19:29:44Z","html_url":"https://github.com/urfu-2015/javascript-tasks-3/pull/51#discussion_r42949091","pull_request_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/pulls/51","_links":{"self":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/pulls/comments/42949091"},"html":{"href":"https://github.com/urfu-2015/javascript-tasks-3/pull/51#discussion_r42949091"},"pull_request":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/pulls/51"}}},"pull_request":{"url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/pulls/51","id":48106606,"html_url":"https://github.com/urfu-2015/javascript-tasks-3/pull/51","diff_url":"https://github.com/urfu-2015/javascript-tasks-3/pull/51.diff","patch_url":"https://github.com/urfu-2015/javascript-tasks-3/pull/51.patch","issue_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/issues/51","number":51,"state":"open","locked":false,"title":"Кузнецов Василий","user":{"login":"VasiliiKuznecov","id":8963033,"avatar_url":"https://avatars.githubusercontent.com/u/8963033?v=3","gravatar_id":"","url":"https://api.github.com/users/VasiliiKuznecov","html_url":"https://github.com/VasiliiKuznecov","followers_url":"https://api.github.com/users/VasiliiKuznecov/followers","following_url":"https://api.github.com/users/VasiliiKuznecov/following{/other_user}","gists_url":"https://api.github.com/users/VasiliiKuznecov/gists{/gist_id}","starred_url":"https://api.github.com/users/VasiliiKuznecov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VasiliiKuznecov/subscriptions","organizations_url":"https://api.github.com/users/VasiliiKuznecov/orgs","repos_url":"https://api.github.com/users/VasiliiKuznecov/repos","events_url":"https://api.github.com/users/VasiliiKuznecov/events{/privacy}","received_events_url":"https://api.github.com/users/VasiliiKuznecov/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-19T18:16:56Z","updated_at":"2015-10-25T19:29:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7a6a171ee4da2e00089e2ce23a1eda1768660ae6","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-3/pulls/51/commits","review_comments_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/pulls/51/comments","review_comment_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/pulls/comments{/number}","comments_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/issues/51/comments","statuses_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/statuses/5a8fb9c0d5906375b544b565db3a5ad153a5fac1","head":{"label":"VasiliiKuznecov:master","ref":"master","sha":"5a8fb9c0d5906375b544b565db3a5ad153a5fac1","user":{"login":"VasiliiKuznecov","id":8963033,"avatar_url":"https://avatars.githubusercontent.com/u/8963033?v=3","gravatar_id":"","url":"https://api.github.com/users/VasiliiKuznecov","html_url":"https://github.com/VasiliiKuznecov","followers_url":"https://api.github.com/users/VasiliiKuznecov/followers","following_url":"https://api.github.com/users/VasiliiKuznecov/following{/other_user}","gists_url":"https://api.github.com/users/VasiliiKuznecov/gists{/gist_id}","starred_url":"https://api.github.com/users/VasiliiKuznecov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VasiliiKuznecov/subscriptions","organizations_url":"https://api.github.com/users/VasiliiKuznecov/orgs","repos_url":"https://api.github.com/users/VasiliiKuznecov/repos","events_url":"https://api.github.com/users/VasiliiKuznecov/events{/privacy}","received_events_url":"https://api.github.com/users/VasiliiKuznecov/received_events","type":"User","site_admin":false},"repo":{"id":44193905,"name":"javascript-tasks-3","full_name":"VasiliiKuznecov/javascript-tasks-3","owner":{"login":"VasiliiKuznecov","id":8963033,"avatar_url":"https://avatars.githubusercontent.com/u/8963033?v=3","gravatar_id":"","url":"https://api.github.com/users/VasiliiKuznecov","html_url":"https://github.com/VasiliiKuznecov","followers_url":"https://api.github.com/users/VasiliiKuznecov/followers","following_url":"https://api.github.com/users/VasiliiKuznecov/following{/other_user}","gists_url":"https://api.github.com/users/VasiliiKuznecov/gists{/gist_id}","starred_url":"https://api.github.com/users/VasiliiKuznecov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VasiliiKuznecov/subscriptions","organizations_url":"https://api.github.com/users/VasiliiKuznecov/orgs","repos_url":"https://api.github.com/users/VasiliiKuznecov/repos","events_url":"https://api.github.com/users/VasiliiKuznecov/events{/privacy}","received_events_url":"https://api.github.com/users/VasiliiKuznecov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/VasiliiKuznecov/javascript-tasks-3","description":"Задача к лекции «Функции в Javascript» – «Картофельная вечеринка»","fork":true,"url":"https://api.github.com/repos/VasiliiKuznecov/javascript-tasks-3","forks_url":"https://api.github.com/repos/VasiliiKuznecov/javascript-tasks-3/forks","keys_url":"https://api.github.com/repos/VasiliiKuznecov/javascript-tasks-3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/VasiliiKuznecov/javascript-tasks-3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/VasiliiKuznecov/javascript-tasks-3/teams","hooks_url":"https://api.github.com/repos/VasiliiKuznecov/javascript-tasks-3/hooks","issue_events_url":"https://api.github.com/repos/VasiliiKuznecov/javascript-tasks-3/issues/events{/number}","events_url":"https://api.github.com/repos/VasiliiKuznecov/javascript-tasks-3/events","assignees_url":"https://api.github.com/repos/VasiliiKuznecov/javascript-tasks-3/assignees{/user}","branches_url":"https://api.github.com/repos/VasiliiKuznecov/javascript-tasks-3/branches{/branch}","tags_url":"https://api.github.com/repos/VasiliiKuznecov/javascript-tasks-3/tags","blobs_url":"https://api.github.com/repos/VasiliiKuznecov/javascript-tasks-3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/VasiliiKuznecov/javascript-tasks-3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/VasiliiKuznecov/javascript-tasks-3/git/refs{/sha}","trees_url":"https://api.github.com/repos/VasiliiKuznecov/javascript-tasks-3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/VasiliiKuznecov/javascript-tasks-3/statuses/{sha}","languages_url":"https://api.github.com/repos/VasiliiKuznecov/javascript-tasks-3/languages","stargazers_url":"https://api.github.com/repos/VasiliiKuznecov/javascript-tasks-3/stargazers","contributors_url":"https://api.github.com/repos/VasiliiKuznecov/javascript-tasks-3/contributors","subscribers_url":"https://api.github.com/repos/VasiliiKuznecov/javascript-tasks-3/subscribers","subscription_url":"https://api.github.com/repos/VasiliiKuznecov/javascript-tasks-3/subscription","commits_url":"https://api.github.com/repos/VasiliiKuznecov/javascript-tasks-3/commits{/sha}","git_commits_url":"https://api.github.com/repos/VasiliiKuznecov/javascript-tasks-3/git/commits{/sha}","comments_url":"https://api.github.com/repos/VasiliiKuznecov/javascript-tasks-3/comments{/number}","issue_comment_url":"https://api.github.com/repos/VasiliiKuznecov/javascript-tasks-3/issues/comments{/number}","contents_url":"https://api.github.com/repos/VasiliiKuznecov/javascript-tasks-3/contents/{+path}","compare_url":"https://api.github.com/repos/VasiliiKuznecov/javascript-tasks-3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/VasiliiKuznecov/javascript-tasks-3/merges","archive_url":"https://api.github.com/repos/VasiliiKuznecov/javascript-tasks-3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/VasiliiKuznecov/javascript-tasks-3/downloads","issues_url":"https://api.github.com/repos/VasiliiKuznecov/javascript-tasks-3/issues{/number}","pulls_url":"https://api.github.com/repos/VasiliiKuznecov/javascript-tasks-3/pulls{/number}","milestones_url":"https://api.github.com/repos/VasiliiKuznecov/javascript-tasks-3/milestones{/number}","notifications_url":"https://api.github.com/repos/VasiliiKuznecov/javascript-tasks-3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/VasiliiKuznecov/javascript-tasks-3/labels{/name}","releases_url":"https://api.github.com/repos/VasiliiKuznecov/javascript-tasks-3/releases{/id}","created_at":"2015-10-13T17:42:33Z","updated_at":"2015-10-13T17:42:33Z","pushed_at":"2015-10-19T18:43:57Z","git_url":"git://github.com/VasiliiKuznecov/javascript-tasks-3.git","ssh_url":"git@github.com:VasiliiKuznecov/javascript-tasks-3.git","clone_url":"https://github.com/VasiliiKuznecov/javascript-tasks-3.git","svn_url":"https://github.com/VasiliiKuznecov/javascript-tasks-3","homepage":"","size":102,"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":"758f14fb6b73fe2ea3682a3cb7794dab5259d0f0","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":44174808,"name":"javascript-tasks-3","full_name":"urfu-2015/javascript-tasks-3","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-3","description":"Задача к лекции «Функции в Javascript» – «Картофельная вечеринка»","fork":false,"url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3","forks_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/forks","keys_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/teams","hooks_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/hooks","issue_events_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/issues/events{/number}","events_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/events","assignees_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/assignees{/user}","branches_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/branches{/branch}","tags_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/tags","blobs_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/git/refs{/sha}","trees_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/statuses/{sha}","languages_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/languages","stargazers_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/stargazers","contributors_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/contributors","subscribers_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/subscribers","subscription_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/subscription","commits_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/commits{/sha}","git_commits_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/git/commits{/sha}","comments_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/comments{/number}","issue_comment_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/issues/comments{/number}","contents_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/contents/{+path}","compare_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/merges","archive_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/downloads","issues_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/issues{/number}","pulls_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/pulls{/number}","milestones_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/milestones{/number}","notifications_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/labels{/name}","releases_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/releases{/id}","created_at":"2015-10-13T12:30:10Z","updated_at":"2015-10-24T17:16:36Z","pushed_at":"2015-10-25T17:55:35Z","git_url":"git://github.com/urfu-2015/javascript-tasks-3.git","ssh_url":"git@github.com:urfu-2015/javascript-tasks-3.git","clone_url":"https://github.com/urfu-2015/javascript-tasks-3.git","svn_url":"https://github.com/urfu-2015/javascript-tasks-3","homepage":"","size":1607,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":78,"mirror_url":null,"open_issues_count":44,"forks":78,"open_issues":44,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/pulls/51"},"html":{"href":"https://github.com/urfu-2015/javascript-tasks-3/pull/51"},"issue":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/issues/51"},"comments":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/issues/51/comments"},"review_comments":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/pulls/51/comments"},"review_comment":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/pulls/51/commits"},"statuses":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/statuses/5a8fb9c0d5906375b544b565db3a5ad153a5fac1"}}}}