{"action":"created","comment":{"url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/pulls/comments/42490764","id":42490764,"diff_hunk":"@@ -15,13 +20,99 @@ module.exports.reverse = function () {\n     };\n };\n \n-// Оператор limit, который выбирает первые N записей\n-module.exports.limit = function (n) {\n-    // Магия\n-};\n-\n // Вам необходимо реализовать остальные операторы:\n // select, filterIn, filterEqual, sortBy, format, limit\n+module.exports.select = function () {\n+    var fields = [].slice.call(arguments);\n+    return function (collection) {\n+        var result = [];\n+        var resultElem = {};\n+        collection.forEach(function (elem) {\n+            fields.forEach(function (field) {\n+                if (field in elem) {\n+                    resultElem[field] = elem[field];\n+                }\n+            });\n+            result.push(resultElem);\n+        });\n+        return result;\n+    };\n+};\n+\n+//\n+module.exports.filterIn = function () {\n+    var args = [].slice.call(arguments);\n+    var filterField = args[0];\n+    var filterValues = args[1];\n+    return function (collection) {\n+        var result = [];\n+        collection.forEach(function (elem) {\n+            filterValues.forEach(function (value) {\n+                if (elem[filterField] == value) {","path":"lego.js","position":51,"original_position":51,"commit_id":"45ad04d33dfe7c9303446b1b4c2f4e399e19b18e","original_commit_id":"45ad04d33dfe7c9303446b1b4c2f4e399e19b18e","user":{"login":"sameoldmadness","id":1537724,"avatar_url":"https://avatars.githubusercontent.com/u/1537724?v=3","gravatar_id":"","url":"https://api.github.com/users/sameoldmadness","html_url":"https://github.com/sameoldmadness","followers_url":"https://api.github.com/users/sameoldmadness/followers","following_url":"https://api.github.com/users/sameoldmadness/following{/other_user}","gists_url":"https://api.github.com/users/sameoldmadness/gists{/gist_id}","starred_url":"https://api.github.com/users/sameoldmadness/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sameoldmadness/subscriptions","organizations_url":"https://api.github.com/users/sameoldmadness/orgs","repos_url":"https://api.github.com/users/sameoldmadness/repos","events_url":"https://api.github.com/users/sameoldmadness/events{/privacy}","received_events_url":"https://api.github.com/users/sameoldmadness/received_events","type":"User","site_admin":false},"body":"Лучше всегда использовать строгое сравнение. Например, сейчас работает так:\r\n```js\r\nconst filter = lego.filterEqual('age', '33');\r\n```","created_at":"2015-10-20T12:54:41Z","updated_at":"2015-10-20T12:54:41Z","html_url":"https://github.com/urfu-2015/javascript-tasks-3/pull/41#discussion_r42490764","pull_request_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/pulls/41","_links":{"self":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/pulls/comments/42490764"},"html":{"href":"https://github.com/urfu-2015/javascript-tasks-3/pull/41#discussion_r42490764"},"pull_request":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/pulls/41"}}},"pull_request":{"url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/pulls/41","id":48098508,"html_url":"https://github.com/urfu-2015/javascript-tasks-3/pull/41","diff_url":"https://github.com/urfu-2015/javascript-tasks-3/pull/41.diff","patch_url":"https://github.com/urfu-2015/javascript-tasks-3/pull/41.patch","issue_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/issues/41","number":41,"state":"open","locked":false,"title":"Соломатов Артем","user":{"login":"avega2991","id":4550080,"avatar_url":"https://avatars.githubusercontent.com/u/4550080?v=3","gravatar_id":"","url":"https://api.github.com/users/avega2991","html_url":"https://github.com/avega2991","followers_url":"https://api.github.com/users/avega2991/followers","following_url":"https://api.github.com/users/avega2991/following{/other_user}","gists_url":"https://api.github.com/users/avega2991/gists{/gist_id}","starred_url":"https://api.github.com/users/avega2991/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avega2991/subscriptions","organizations_url":"https://api.github.com/users/avega2991/orgs","repos_url":"https://api.github.com/users/avega2991/repos","events_url":"https://api.github.com/users/avega2991/events{/privacy}","received_events_url":"https://api.github.com/users/avega2991/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-19T17:02:08Z","updated_at":"2015-10-20T12:54:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f4bf5005b0c0ad7f6895bea2a67d6bf6c31fb8b4","assignee":{"login":"sameoldmadness","id":1537724,"avatar_url":"https://avatars.githubusercontent.com/u/1537724?v=3","gravatar_id":"","url":"https://api.github.com/users/sameoldmadness","html_url":"https://github.com/sameoldmadness","followers_url":"https://api.github.com/users/sameoldmadness/followers","following_url":"https://api.github.com/users/sameoldmadness/following{/other_user}","gists_url":"https://api.github.com/users/sameoldmadness/gists{/gist_id}","starred_url":"https://api.github.com/users/sameoldmadness/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sameoldmadness/subscriptions","organizations_url":"https://api.github.com/users/sameoldmadness/orgs","repos_url":"https://api.github.com/users/sameoldmadness/repos","events_url":"https://api.github.com/users/sameoldmadness/events{/privacy}","received_events_url":"https://api.github.com/users/sameoldmadness/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/pulls/41/commits","review_comments_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/pulls/41/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/41/comments","statuses_url":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/statuses/45ad04d33dfe7c9303446b1b4c2f4e399e19b18e","head":{"label":"avega2991:my-solution","ref":"my-solution","sha":"45ad04d33dfe7c9303446b1b4c2f4e399e19b18e","user":{"login":"avega2991","id":4550080,"avatar_url":"https://avatars.githubusercontent.com/u/4550080?v=3","gravatar_id":"","url":"https://api.github.com/users/avega2991","html_url":"https://github.com/avega2991","followers_url":"https://api.github.com/users/avega2991/followers","following_url":"https://api.github.com/users/avega2991/following{/other_user}","gists_url":"https://api.github.com/users/avega2991/gists{/gist_id}","starred_url":"https://api.github.com/users/avega2991/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avega2991/subscriptions","organizations_url":"https://api.github.com/users/avega2991/orgs","repos_url":"https://api.github.com/users/avega2991/repos","events_url":"https://api.github.com/users/avega2991/events{/privacy}","received_events_url":"https://api.github.com/users/avega2991/received_events","type":"User","site_admin":false},"repo":{"id":44549925,"name":"javascript-tasks-3","full_name":"avega2991/javascript-tasks-3","owner":{"login":"avega2991","id":4550080,"avatar_url":"https://avatars.githubusercontent.com/u/4550080?v=3","gravatar_id":"","url":"https://api.github.com/users/avega2991","html_url":"https://github.com/avega2991","followers_url":"https://api.github.com/users/avega2991/followers","following_url":"https://api.github.com/users/avega2991/following{/other_user}","gists_url":"https://api.github.com/users/avega2991/gists{/gist_id}","starred_url":"https://api.github.com/users/avega2991/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avega2991/subscriptions","organizations_url":"https://api.github.com/users/avega2991/orgs","repos_url":"https://api.github.com/users/avega2991/repos","events_url":"https://api.github.com/users/avega2991/events{/privacy}","received_events_url":"https://api.github.com/users/avega2991/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/avega2991/javascript-tasks-3","description":"Задача к лекции «Функции в Javascript» – «Картофельная вечеринка»","fork":true,"url":"https://api.github.com/repos/avega2991/javascript-tasks-3","forks_url":"https://api.github.com/repos/avega2991/javascript-tasks-3/forks","keys_url":"https://api.github.com/repos/avega2991/javascript-tasks-3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/avega2991/javascript-tasks-3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/avega2991/javascript-tasks-3/teams","hooks_url":"https://api.github.com/repos/avega2991/javascript-tasks-3/hooks","issue_events_url":"https://api.github.com/repos/avega2991/javascript-tasks-3/issues/events{/number}","events_url":"https://api.github.com/repos/avega2991/javascript-tasks-3/events","assignees_url":"https://api.github.com/repos/avega2991/javascript-tasks-3/assignees{/user}","branches_url":"https://api.github.com/repos/avega2991/javascript-tasks-3/branches{/branch}","tags_url":"https://api.github.com/repos/avega2991/javascript-tasks-3/tags","blobs_url":"https://api.github.com/repos/avega2991/javascript-tasks-3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/avega2991/javascript-tasks-3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/avega2991/javascript-tasks-3/git/refs{/sha}","trees_url":"https://api.github.com/repos/avega2991/javascript-tasks-3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/avega2991/javascript-tasks-3/statuses/{sha}","languages_url":"https://api.github.com/repos/avega2991/javascript-tasks-3/languages","stargazers_url":"https://api.github.com/repos/avega2991/javascript-tasks-3/stargazers","contributors_url":"https://api.github.com/repos/avega2991/javascript-tasks-3/contributors","subscribers_url":"https://api.github.com/repos/avega2991/javascript-tasks-3/subscribers","subscription_url":"https://api.github.com/repos/avega2991/javascript-tasks-3/subscription","commits_url":"https://api.github.com/repos/avega2991/javascript-tasks-3/commits{/sha}","git_commits_url":"https://api.github.com/repos/avega2991/javascript-tasks-3/git/commits{/sha}","comments_url":"https://api.github.com/repos/avega2991/javascript-tasks-3/comments{/number}","issue_comment_url":"https://api.github.com/repos/avega2991/javascript-tasks-3/issues/comments{/number}","contents_url":"https://api.github.com/repos/avega2991/javascript-tasks-3/contents/{+path}","compare_url":"https://api.github.com/repos/avega2991/javascript-tasks-3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/avega2991/javascript-tasks-3/merges","archive_url":"https://api.github.com/repos/avega2991/javascript-tasks-3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/avega2991/javascript-tasks-3/downloads","issues_url":"https://api.github.com/repos/avega2991/javascript-tasks-3/issues{/number}","pulls_url":"https://api.github.com/repos/avega2991/javascript-tasks-3/pulls{/number}","milestones_url":"https://api.github.com/repos/avega2991/javascript-tasks-3/milestones{/number}","notifications_url":"https://api.github.com/repos/avega2991/javascript-tasks-3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/avega2991/javascript-tasks-3/labels{/name}","releases_url":"https://api.github.com/repos/avega2991/javascript-tasks-3/releases{/id}","created_at":"2015-10-19T16:58:57Z","updated_at":"2015-10-19T16:58:58Z","pushed_at":"2015-10-19T17:00:59Z","git_url":"git://github.com/avega2991/javascript-tasks-3.git","ssh_url":"git@github.com:avega2991/javascript-tasks-3.git","clone_url":"https://github.com/avega2991/javascript-tasks-3.git","svn_url":"https://github.com/avega2991/javascript-tasks-3","homepage":"","size":89,"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-14T06:19:52Z","pushed_at":"2015-10-20T12:48:28Z","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":1517,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":77,"mirror_url":null,"open_issues_count":59,"forks":77,"open_issues":59,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/pulls/41"},"html":{"href":"https://github.com/urfu-2015/javascript-tasks-3/pull/41"},"issue":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/issues/41"},"comments":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/issues/41/comments"},"review_comments":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/pulls/41/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/41/commits"},"statuses":{"href":"https://api.github.com/repos/urfu-2015/javascript-tasks-3/statuses/45ad04d33dfe7c9303446b1b4c2f4e399e19b18e"}}}}