{"action":"created","comment":{"url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/pulls/comments/43672037","id":43672037,"diff_hunk":"@@ -0,0 +1,105 @@\n+'use strict';\n+\n+// All of the callbacks in questions 3 through 5 should\n+// be called with the current element in the array,\n+// its index, and the array itself\n+// e.g. callback(currentValue, index, array)\n+\n+// Question 1\n+// Write a callback for reduce that selects\n+// the minimum value in the array\n+var min = function min (previousValue, currentValue){\n+  if (previousValue < currentValue){\n+    return previousValue;\n+  } else { return currentValue;\n+  }\n+};\n+\n+[1, 5, 7, 3, -5, 0].reduce(min);\n+\n+\n+// Question 2\n+// Write a callback for reduce that produces\n+// the sum of the values in the array\n+var sum = function sum(previousValue, currentValue) {\n+  return previousValue + currentValue;\n+};\n+\n+[1, 5, 7, 3, -5, 0].reduce(add);\n+\n+\n+\n+// Question 3\n+// Write a function that returns true\n+// if invoking the callback for any element\n+// in the array returns a truthy value\n+var any = function any(array, callback, thisArg) {\n+  var result = false;\n+array.forEach(function(currentValue, index, array) {\n+result = result || callback(currentValue, index, array);\n+ });\n+\n+ return result;\n+};\n+var even = function(value){\n+    if (value % 2 !== 0){\n+        return false;\n+    } else { return true;\n+}\n+}\n+\n+any([1, 2, 3], even);\n+\n+\n+// Question 4\n+// Write a function that returns a new array\n+// made up of the array elements for which invoking\n+// the callback returns a truthy value\n+var select = function select(array, callback, thisArg) {\n+  var result = false;\n+  array.forEach(function(currentValue, index, array) {\n+    result = result || callback(currentValue, index, array);\n+ });\n+\n+ return result;\n+};\n+\n+var even = function(value){\n+    if (value % 2 !== 0){\n+        return false;\n+    } else { return [5, 6, 3, 7];\n+  }\n+};\n+\n+select([1, 2, 3], even)\n+// Question 5\n+// Write a function that returns the first element\n+// for which invoking the callback returns a truthy value\n+var find = function find(array, callback, thisArg) {\n+  var result = false;\n+  array.forEach(function(currentValue, index, array) {\n+    result = result || callback(currentValue, index, array);\n+ });\n+\n+ return result;\n+};","path":"lib/assessment_redux_10_29_15.js","position":85,"original_position":85,"commit_id":"ddbda6eea70070a3ccca795a87941db219eff04f","original_commit_id":"ddbda6eea70070a3ccca795a87941db219eff04f","user":{"login":"srhoulam","id":7725148,"avatar_url":"https://avatars.githubusercontent.com/u/7725148?v=3","gravatar_id":"","url":"https://api.github.com/users/srhoulam","html_url":"https://github.com/srhoulam","followers_url":"https://api.github.com/users/srhoulam/followers","following_url":"https://api.github.com/users/srhoulam/following{/other_user}","gists_url":"https://api.github.com/users/srhoulam/gists{/gist_id}","starred_url":"https://api.github.com/users/srhoulam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srhoulam/subscriptions","organizations_url":"https://api.github.com/users/srhoulam/orgs","repos_url":"https://api.github.com/users/srhoulam/repos","events_url":"https://api.github.com/users/srhoulam/events{/privacy}","received_events_url":"https://api.github.com/users/srhoulam/received_events","type":"User","site_admin":false},"body":"This is `any` again.","created_at":"2015-11-02T19:45:05Z","updated_at":"2015-11-02T19:45:05Z","html_url":"https://github.com/ga-wdi-boston/js-array-methods-assessment/pull/41#discussion_r43672037","pull_request_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/pulls/41","_links":{"self":{"href":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/pulls/comments/43672037"},"html":{"href":"https://github.com/ga-wdi-boston/js-array-methods-assessment/pull/41#discussion_r43672037"},"pull_request":{"href":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/pulls/41"}}},"pull_request":{"url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/pulls/41","id":49220148,"html_url":"https://github.com/ga-wdi-boston/js-array-methods-assessment/pull/41","diff_url":"https://github.com/ga-wdi-boston/js-array-methods-assessment/pull/41.diff","patch_url":"https://github.com/ga-wdi-boston/js-array-methods-assessment/pull/41.patch","issue_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/issues/41","number":41,"state":"open","locked":false,"title":"Assessment","user":{"login":"julie1013","id":14143334,"avatar_url":"https://avatars.githubusercontent.com/u/14143334?v=3","gravatar_id":"","url":"https://api.github.com/users/julie1013","html_url":"https://github.com/julie1013","followers_url":"https://api.github.com/users/julie1013/followers","following_url":"https://api.github.com/users/julie1013/following{/other_user}","gists_url":"https://api.github.com/users/julie1013/gists{/gist_id}","starred_url":"https://api.github.com/users/julie1013/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/julie1013/subscriptions","organizations_url":"https://api.github.com/users/julie1013/orgs","repos_url":"https://api.github.com/users/julie1013/repos","events_url":"https://api.github.com/users/julie1013/events{/privacy}","received_events_url":"https://api.github.com/users/julie1013/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-30T00:57:05Z","updated_at":"2015-11-02T19:45:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0b11fba2c8aa81c318c7f8e2844817f3fd48ccaf","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/pulls/41/commits","review_comments_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/pulls/41/comments","review_comment_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/issues/41/comments","statuses_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/statuses/ddbda6eea70070a3ccca795a87941db219eff04f","head":{"label":"julie1013:assessment","ref":"assessment","sha":"ddbda6eea70070a3ccca795a87941db219eff04f","user":{"login":"julie1013","id":14143334,"avatar_url":"https://avatars.githubusercontent.com/u/14143334?v=3","gravatar_id":"","url":"https://api.github.com/users/julie1013","html_url":"https://github.com/julie1013","followers_url":"https://api.github.com/users/julie1013/followers","following_url":"https://api.github.com/users/julie1013/following{/other_user}","gists_url":"https://api.github.com/users/julie1013/gists{/gist_id}","starred_url":"https://api.github.com/users/julie1013/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/julie1013/subscriptions","organizations_url":"https://api.github.com/users/julie1013/orgs","repos_url":"https://api.github.com/users/julie1013/repos","events_url":"https://api.github.com/users/julie1013/events{/privacy}","received_events_url":"https://api.github.com/users/julie1013/received_events","type":"User","site_admin":false},"repo":{"id":43839298,"name":"js-array-methods-assessment","full_name":"julie1013/js-array-methods-assessment","owner":{"login":"julie1013","id":14143334,"avatar_url":"https://avatars.githubusercontent.com/u/14143334?v=3","gravatar_id":"","url":"https://api.github.com/users/julie1013","html_url":"https://github.com/julie1013","followers_url":"https://api.github.com/users/julie1013/followers","following_url":"https://api.github.com/users/julie1013/following{/other_user}","gists_url":"https://api.github.com/users/julie1013/gists{/gist_id}","starred_url":"https://api.github.com/users/julie1013/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/julie1013/subscriptions","organizations_url":"https://api.github.com/users/julie1013/orgs","repos_url":"https://api.github.com/users/julie1013/repos","events_url":"https://api.github.com/users/julie1013/events{/privacy}","received_events_url":"https://api.github.com/users/julie1013/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/julie1013/js-array-methods-assessment","description":"Assessment for \"JavaScript Array methods\"","fork":true,"url":"https://api.github.com/repos/julie1013/js-array-methods-assessment","forks_url":"https://api.github.com/repos/julie1013/js-array-methods-assessment/forks","keys_url":"https://api.github.com/repos/julie1013/js-array-methods-assessment/keys{/key_id}","collaborators_url":"https://api.github.com/repos/julie1013/js-array-methods-assessment/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/julie1013/js-array-methods-assessment/teams","hooks_url":"https://api.github.com/repos/julie1013/js-array-methods-assessment/hooks","issue_events_url":"https://api.github.com/repos/julie1013/js-array-methods-assessment/issues/events{/number}","events_url":"https://api.github.com/repos/julie1013/js-array-methods-assessment/events","assignees_url":"https://api.github.com/repos/julie1013/js-array-methods-assessment/assignees{/user}","branches_url":"https://api.github.com/repos/julie1013/js-array-methods-assessment/branches{/branch}","tags_url":"https://api.github.com/repos/julie1013/js-array-methods-assessment/tags","blobs_url":"https://api.github.com/repos/julie1013/js-array-methods-assessment/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/julie1013/js-array-methods-assessment/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/julie1013/js-array-methods-assessment/git/refs{/sha}","trees_url":"https://api.github.com/repos/julie1013/js-array-methods-assessment/git/trees{/sha}","statuses_url":"https://api.github.com/repos/julie1013/js-array-methods-assessment/statuses/{sha}","languages_url":"https://api.github.com/repos/julie1013/js-array-methods-assessment/languages","stargazers_url":"https://api.github.com/repos/julie1013/js-array-methods-assessment/stargazers","contributors_url":"https://api.github.com/repos/julie1013/js-array-methods-assessment/contributors","subscribers_url":"https://api.github.com/repos/julie1013/js-array-methods-assessment/subscribers","subscription_url":"https://api.github.com/repos/julie1013/js-array-methods-assessment/subscription","commits_url":"https://api.github.com/repos/julie1013/js-array-methods-assessment/commits{/sha}","git_commits_url":"https://api.github.com/repos/julie1013/js-array-methods-assessment/git/commits{/sha}","comments_url":"https://api.github.com/repos/julie1013/js-array-methods-assessment/comments{/number}","issue_comment_url":"https://api.github.com/repos/julie1013/js-array-methods-assessment/issues/comments{/number}","contents_url":"https://api.github.com/repos/julie1013/js-array-methods-assessment/contents/{+path}","compare_url":"https://api.github.com/repos/julie1013/js-array-methods-assessment/compare/{base}...{head}","merges_url":"https://api.github.com/repos/julie1013/js-array-methods-assessment/merges","archive_url":"https://api.github.com/repos/julie1013/js-array-methods-assessment/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/julie1013/js-array-methods-assessment/downloads","issues_url":"https://api.github.com/repos/julie1013/js-array-methods-assessment/issues{/number}","pulls_url":"https://api.github.com/repos/julie1013/js-array-methods-assessment/pulls{/number}","milestones_url":"https://api.github.com/repos/julie1013/js-array-methods-assessment/milestones{/number}","notifications_url":"https://api.github.com/repos/julie1013/js-array-methods-assessment/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/julie1013/js-array-methods-assessment/labels{/name}","releases_url":"https://api.github.com/repos/julie1013/js-array-methods-assessment/releases{/id}","created_at":"2015-10-07T19:17:46Z","updated_at":"2015-10-07T19:17:47Z","pushed_at":"2015-10-30T00:55:36Z","git_url":"git://github.com/julie1013/js-array-methods-assessment.git","ssh_url":"git@github.com:julie1013/js-array-methods-assessment.git","clone_url":"https://github.com/julie1013/js-array-methods-assessment.git","svn_url":"https://github.com/julie1013/js-array-methods-assessment","homepage":null,"size":87,"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":"ga-wdi-boston:master","ref":"master","sha":"e58a689af42bf06cdeba28c64c7093fb4f7261af","user":{"login":"ga-wdi-boston","id":6361298,"avatar_url":"https://avatars.githubusercontent.com/u/6361298?v=3","gravatar_id":"","url":"https://api.github.com/users/ga-wdi-boston","html_url":"https://github.com/ga-wdi-boston","followers_url":"https://api.github.com/users/ga-wdi-boston/followers","following_url":"https://api.github.com/users/ga-wdi-boston/following{/other_user}","gists_url":"https://api.github.com/users/ga-wdi-boston/gists{/gist_id}","starred_url":"https://api.github.com/users/ga-wdi-boston/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ga-wdi-boston/subscriptions","organizations_url":"https://api.github.com/users/ga-wdi-boston/orgs","repos_url":"https://api.github.com/users/ga-wdi-boston/repos","events_url":"https://api.github.com/users/ga-wdi-boston/events{/privacy}","received_events_url":"https://api.github.com/users/ga-wdi-boston/received_events","type":"Organization","site_admin":false},"repo":{"id":43658172,"name":"js-array-methods-assessment","full_name":"ga-wdi-boston/js-array-methods-assessment","owner":{"login":"ga-wdi-boston","id":6361298,"avatar_url":"https://avatars.githubusercontent.com/u/6361298?v=3","gravatar_id":"","url":"https://api.github.com/users/ga-wdi-boston","html_url":"https://github.com/ga-wdi-boston","followers_url":"https://api.github.com/users/ga-wdi-boston/followers","following_url":"https://api.github.com/users/ga-wdi-boston/following{/other_user}","gists_url":"https://api.github.com/users/ga-wdi-boston/gists{/gist_id}","starred_url":"https://api.github.com/users/ga-wdi-boston/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ga-wdi-boston/subscriptions","organizations_url":"https://api.github.com/users/ga-wdi-boston/orgs","repos_url":"https://api.github.com/users/ga-wdi-boston/repos","events_url":"https://api.github.com/users/ga-wdi-boston/events{/privacy}","received_events_url":"https://api.github.com/users/ga-wdi-boston/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ga-wdi-boston/js-array-methods-assessment","description":"Assessment for \"JavaScript Array methods\"","fork":false,"url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment","forks_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/forks","keys_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/teams","hooks_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/hooks","issue_events_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/issues/events{/number}","events_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/events","assignees_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/assignees{/user}","branches_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/branches{/branch}","tags_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/tags","blobs_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/git/refs{/sha}","trees_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/statuses/{sha}","languages_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/languages","stargazers_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/stargazers","contributors_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/contributors","subscribers_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/subscribers","subscription_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/subscription","commits_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/commits{/sha}","git_commits_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/git/commits{/sha}","comments_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/comments{/number}","issue_comment_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/issues/comments{/number}","contents_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/contents/{+path}","compare_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/merges","archive_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/downloads","issues_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/issues{/number}","pulls_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/pulls{/number}","milestones_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/milestones{/number}","notifications_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/labels{/name}","releases_url":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/releases{/id}","created_at":"2015-10-05T00:25:39Z","updated_at":"2015-10-05T00:26:39Z","pushed_at":"2015-10-30T20:09:29Z","git_url":"git://github.com/ga-wdi-boston/js-array-methods-assessment.git","ssh_url":"git@github.com:ga-wdi-boston/js-array-methods-assessment.git","clone_url":"https://github.com/ga-wdi-boston/js-array-methods-assessment.git","svn_url":"https://github.com/ga-wdi-boston/js-array-methods-assessment","homepage":null,"size":620,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":32,"mirror_url":null,"open_issues_count":6,"forks":32,"open_issues":6,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/pulls/41"},"html":{"href":"https://github.com/ga-wdi-boston/js-array-methods-assessment/pull/41"},"issue":{"href":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/issues/41"},"comments":{"href":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/issues/41/comments"},"review_comments":{"href":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/pulls/41/comments"},"review_comment":{"href":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/pulls/41/commits"},"statuses":{"href":"https://api.github.com/repos/ga-wdi-boston/js-array-methods-assessment/statuses/ddbda6eea70070a3ccca795a87941db219eff04f"}}}}