{"action":"created","comment":{"url":"https://api.github.com/repos/ilya7/js-training/pulls/comments/33423184","id":33423184,"diff_hunk":"@@ -0,0 +1,176 @@\n+// Problem 1\n+function F() {\n+    var args = Array.prototype.slice.call(arguments),\n+        G = args[args.length - 1],\n+        fArgs = args.slice(0, args.length - 1);\n+\n+    return function () {\n+        var args = Array.prototype.slice.call(arguments);\n+        return G.apply(this, fArgs.concat(args)); \n+    };\n+}\n+\n+\n+// Problem 2\n+function curry(f) {\n+    var args = [];\n+\n+    return function curried(x) {\n+        args.push(x);\n+\n+        if (args.length === f.length) {\n+            return f.apply(this, args);\n+        } else {\n+            return curried;\n+        }\n+    }\n+}\n+\n+\n+// Problem 3\n+function fold(a, callback, initialValue) {\n+    var previousValue, i;\n+\n+    if (initialValue) {\n+        previousValue = initialValue;\n+        i = 0;\n+    } else {\n+        previousValue = a[0];\n+        i = 1;\n+    }\n+\n+    while (i < a.length) {\n+        previousValue = callback.call(this, previousValue, a[i], i, a);","path":"practical_1/script.js","position":43,"original_position":43,"commit_id":"8a1f0d3cada0be0fff4473cce8306a51ac002126","original_commit_id":"8a1f0d3cada0be0fff4473cce8306a51ac002126","user":{"login":"Shalimov","id":5468176,"avatar_url":"https://avatars.githubusercontent.com/u/5468176?v=3","gravatar_id":"","url":"https://api.github.com/users/Shalimov","html_url":"https://github.com/Shalimov","followers_url":"https://api.github.com/users/Shalimov/followers","following_url":"https://api.github.com/users/Shalimov/following{/other_user}","gists_url":"https://api.github.com/users/Shalimov/gists{/gist_id}","starred_url":"https://api.github.com/users/Shalimov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shalimov/subscriptions","organizations_url":"https://api.github.com/users/Shalimov/orgs","repos_url":"https://api.github.com/users/Shalimov/repos","events_url":"https://api.github.com/users/Shalimov/events{/privacy}","received_events_url":"https://api.github.com/users/Shalimov/received_events","type":"User","site_admin":false},"body":"Думаю что вызов **call** здесь не очень уместен (применительно к использованию **this** в качестве контекста).  \r\nFolding aka Reduce это скорее отдельная утилита и очень сомнительно её использование как метода объекта.\r\nХотя если добавить в список параметров последним элементом аргумент **ctx** то при вызове можно задавать контекст для исполняемого метода и спокойно использовать **.cal(ctx, ...)l**. ","created_at":"2015-06-28T14:10:43Z","updated_at":"2015-06-28T14:10:43Z","html_url":"https://github.com/ilya7/js-training/pull/1#discussion_r33423184","pull_request_url":"https://api.github.com/repos/ilya7/js-training/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/ilya7/js-training/pulls/comments/33423184"},"html":{"href":"https://github.com/ilya7/js-training/pull/1#discussion_r33423184"},"pull_request":{"href":"https://api.github.com/repos/ilya7/js-training/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/ilya7/js-training/pulls/1","id":36285263,"html_url":"https://github.com/ilya7/js-training/pull/1","diff_url":"https://github.com/ilya7/js-training/pull/1.diff","patch_url":"https://github.com/ilya7/js-training/pull/1.patch","issue_url":"https://api.github.com/repos/ilya7/js-training/issues/1","number":1,"state":"open","locked":false,"title":"Queze 1 - Functional Programming","user":{"login":"ilya7","id":12406983,"avatar_url":"https://avatars.githubusercontent.com/u/12406983?v=3","gravatar_id":"","url":"https://api.github.com/users/ilya7","html_url":"https://github.com/ilya7","followers_url":"https://api.github.com/users/ilya7/followers","following_url":"https://api.github.com/users/ilya7/following{/other_user}","gists_url":"https://api.github.com/users/ilya7/gists{/gist_id}","starred_url":"https://api.github.com/users/ilya7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilya7/subscriptions","organizations_url":"https://api.github.com/users/ilya7/orgs","repos_url":"https://api.github.com/users/ilya7/repos","events_url":"https://api.github.com/users/ilya7/events{/privacy}","received_events_url":"https://api.github.com/users/ilya7/received_events","type":"User","site_admin":false},"body":"Без problem 8, problem 10","created_at":"2015-05-27T09:35:52Z","updated_at":"2015-06-28T14:10:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"241accaa3a4eb7b2b4870e176ad19b18cee1a83e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ilya7/js-training/pulls/1/commits","review_comments_url":"https://api.github.com/repos/ilya7/js-training/pulls/1/comments","review_comment_url":"https://api.github.com/repos/ilya7/js-training/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ilya7/js-training/issues/1/comments","statuses_url":"https://api.github.com/repos/ilya7/js-training/statuses/8a1f0d3cada0be0fff4473cce8306a51ac002126","head":{"label":"ilya7:development","ref":"development","sha":"8a1f0d3cada0be0fff4473cce8306a51ac002126","user":{"login":"ilya7","id":12406983,"avatar_url":"https://avatars.githubusercontent.com/u/12406983?v=3","gravatar_id":"","url":"https://api.github.com/users/ilya7","html_url":"https://github.com/ilya7","followers_url":"https://api.github.com/users/ilya7/followers","following_url":"https://api.github.com/users/ilya7/following{/other_user}","gists_url":"https://api.github.com/users/ilya7/gists{/gist_id}","starred_url":"https://api.github.com/users/ilya7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilya7/subscriptions","organizations_url":"https://api.github.com/users/ilya7/orgs","repos_url":"https://api.github.com/users/ilya7/repos","events_url":"https://api.github.com/users/ilya7/events{/privacy}","received_events_url":"https://api.github.com/users/ilya7/received_events","type":"User","site_admin":false},"repo":{"id":36355602,"name":"js-training","full_name":"ilya7/js-training","owner":{"login":"ilya7","id":12406983,"avatar_url":"https://avatars.githubusercontent.com/u/12406983?v=3","gravatar_id":"","url":"https://api.github.com/users/ilya7","html_url":"https://github.com/ilya7","followers_url":"https://api.github.com/users/ilya7/followers","following_url":"https://api.github.com/users/ilya7/following{/other_user}","gists_url":"https://api.github.com/users/ilya7/gists{/gist_id}","starred_url":"https://api.github.com/users/ilya7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilya7/subscriptions","organizations_url":"https://api.github.com/users/ilya7/orgs","repos_url":"https://api.github.com/users/ilya7/repos","events_url":"https://api.github.com/users/ilya7/events{/privacy}","received_events_url":"https://api.github.com/users/ilya7/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ilya7/js-training","description":"","fork":false,"url":"https://api.github.com/repos/ilya7/js-training","forks_url":"https://api.github.com/repos/ilya7/js-training/forks","keys_url":"https://api.github.com/repos/ilya7/js-training/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ilya7/js-training/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ilya7/js-training/teams","hooks_url":"https://api.github.com/repos/ilya7/js-training/hooks","issue_events_url":"https://api.github.com/repos/ilya7/js-training/issues/events{/number}","events_url":"https://api.github.com/repos/ilya7/js-training/events","assignees_url":"https://api.github.com/repos/ilya7/js-training/assignees{/user}","branches_url":"https://api.github.com/repos/ilya7/js-training/branches{/branch}","tags_url":"https://api.github.com/repos/ilya7/js-training/tags","blobs_url":"https://api.github.com/repos/ilya7/js-training/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ilya7/js-training/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ilya7/js-training/git/refs{/sha}","trees_url":"https://api.github.com/repos/ilya7/js-training/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ilya7/js-training/statuses/{sha}","languages_url":"https://api.github.com/repos/ilya7/js-training/languages","stargazers_url":"https://api.github.com/repos/ilya7/js-training/stargazers","contributors_url":"https://api.github.com/repos/ilya7/js-training/contributors","subscribers_url":"https://api.github.com/repos/ilya7/js-training/subscribers","subscription_url":"https://api.github.com/repos/ilya7/js-training/subscription","commits_url":"https://api.github.com/repos/ilya7/js-training/commits{/sha}","git_commits_url":"https://api.github.com/repos/ilya7/js-training/git/commits{/sha}","comments_url":"https://api.github.com/repos/ilya7/js-training/comments{/number}","issue_comment_url":"https://api.github.com/repos/ilya7/js-training/issues/comments{/number}","contents_url":"https://api.github.com/repos/ilya7/js-training/contents/{+path}","compare_url":"https://api.github.com/repos/ilya7/js-training/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ilya7/js-training/merges","archive_url":"https://api.github.com/repos/ilya7/js-training/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ilya7/js-training/downloads","issues_url":"https://api.github.com/repos/ilya7/js-training/issues{/number}","pulls_url":"https://api.github.com/repos/ilya7/js-training/pulls{/number}","milestones_url":"https://api.github.com/repos/ilya7/js-training/milestones{/number}","notifications_url":"https://api.github.com/repos/ilya7/js-training/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ilya7/js-training/labels{/name}","releases_url":"https://api.github.com/repos/ilya7/js-training/releases{/id}","created_at":"2015-05-27T09:02:50Z","updated_at":"2015-05-27T09:02:50Z","pushed_at":"2015-06-10T19:39:32Z","git_url":"git://github.com/ilya7/js-training.git","ssh_url":"git@github.com:ilya7/js-training.git","clone_url":"https://github.com/ilya7/js-training.git","svn_url":"https://github.com/ilya7/js-training","homepage":null,"size":172,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"ilya7:master","ref":"master","sha":"f8dc0b76267190110ec3f74f877cc083f3bf98b4","user":{"login":"ilya7","id":12406983,"avatar_url":"https://avatars.githubusercontent.com/u/12406983?v=3","gravatar_id":"","url":"https://api.github.com/users/ilya7","html_url":"https://github.com/ilya7","followers_url":"https://api.github.com/users/ilya7/followers","following_url":"https://api.github.com/users/ilya7/following{/other_user}","gists_url":"https://api.github.com/users/ilya7/gists{/gist_id}","starred_url":"https://api.github.com/users/ilya7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilya7/subscriptions","organizations_url":"https://api.github.com/users/ilya7/orgs","repos_url":"https://api.github.com/users/ilya7/repos","events_url":"https://api.github.com/users/ilya7/events{/privacy}","received_events_url":"https://api.github.com/users/ilya7/received_events","type":"User","site_admin":false},"repo":{"id":36355602,"name":"js-training","full_name":"ilya7/js-training","owner":{"login":"ilya7","id":12406983,"avatar_url":"https://avatars.githubusercontent.com/u/12406983?v=3","gravatar_id":"","url":"https://api.github.com/users/ilya7","html_url":"https://github.com/ilya7","followers_url":"https://api.github.com/users/ilya7/followers","following_url":"https://api.github.com/users/ilya7/following{/other_user}","gists_url":"https://api.github.com/users/ilya7/gists{/gist_id}","starred_url":"https://api.github.com/users/ilya7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilya7/subscriptions","organizations_url":"https://api.github.com/users/ilya7/orgs","repos_url":"https://api.github.com/users/ilya7/repos","events_url":"https://api.github.com/users/ilya7/events{/privacy}","received_events_url":"https://api.github.com/users/ilya7/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ilya7/js-training","description":"","fork":false,"url":"https://api.github.com/repos/ilya7/js-training","forks_url":"https://api.github.com/repos/ilya7/js-training/forks","keys_url":"https://api.github.com/repos/ilya7/js-training/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ilya7/js-training/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ilya7/js-training/teams","hooks_url":"https://api.github.com/repos/ilya7/js-training/hooks","issue_events_url":"https://api.github.com/repos/ilya7/js-training/issues/events{/number}","events_url":"https://api.github.com/repos/ilya7/js-training/events","assignees_url":"https://api.github.com/repos/ilya7/js-training/assignees{/user}","branches_url":"https://api.github.com/repos/ilya7/js-training/branches{/branch}","tags_url":"https://api.github.com/repos/ilya7/js-training/tags","blobs_url":"https://api.github.com/repos/ilya7/js-training/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ilya7/js-training/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ilya7/js-training/git/refs{/sha}","trees_url":"https://api.github.com/repos/ilya7/js-training/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ilya7/js-training/statuses/{sha}","languages_url":"https://api.github.com/repos/ilya7/js-training/languages","stargazers_url":"https://api.github.com/repos/ilya7/js-training/stargazers","contributors_url":"https://api.github.com/repos/ilya7/js-training/contributors","subscribers_url":"https://api.github.com/repos/ilya7/js-training/subscribers","subscription_url":"https://api.github.com/repos/ilya7/js-training/subscription","commits_url":"https://api.github.com/repos/ilya7/js-training/commits{/sha}","git_commits_url":"https://api.github.com/repos/ilya7/js-training/git/commits{/sha}","comments_url":"https://api.github.com/repos/ilya7/js-training/comments{/number}","issue_comment_url":"https://api.github.com/repos/ilya7/js-training/issues/comments{/number}","contents_url":"https://api.github.com/repos/ilya7/js-training/contents/{+path}","compare_url":"https://api.github.com/repos/ilya7/js-training/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ilya7/js-training/merges","archive_url":"https://api.github.com/repos/ilya7/js-training/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ilya7/js-training/downloads","issues_url":"https://api.github.com/repos/ilya7/js-training/issues{/number}","pulls_url":"https://api.github.com/repos/ilya7/js-training/pulls{/number}","milestones_url":"https://api.github.com/repos/ilya7/js-training/milestones{/number}","notifications_url":"https://api.github.com/repos/ilya7/js-training/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ilya7/js-training/labels{/name}","releases_url":"https://api.github.com/repos/ilya7/js-training/releases{/id}","created_at":"2015-05-27T09:02:50Z","updated_at":"2015-05-27T09:02:50Z","pushed_at":"2015-06-10T19:39:32Z","git_url":"git://github.com/ilya7/js-training.git","ssh_url":"git@github.com:ilya7/js-training.git","clone_url":"https://github.com/ilya7/js-training.git","svn_url":"https://github.com/ilya7/js-training","homepage":null,"size":172,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ilya7/js-training/pulls/1"},"html":{"href":"https://github.com/ilya7/js-training/pull/1"},"issue":{"href":"https://api.github.com/repos/ilya7/js-training/issues/1"},"comments":{"href":"https://api.github.com/repos/ilya7/js-training/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/ilya7/js-training/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/ilya7/js-training/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ilya7/js-training/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/ilya7/js-training/statuses/8a1f0d3cada0be0fff4473cce8306a51ac002126"}}}}