{"action":"created","comment":{"url":"https://api.github.com/repos/ellisken/code-challenges/pulls/comments/219257325","pull_request_review_id":157390806,"id":219257325,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxOTI1NzMyNQ==","diff_hunk":"@@ -0,0 +1,252 @@\n+'use strict';\n+/* global describe, expect, test */\n+\n+// ------------------------------------------------------------------------------------------------\n+// CHALLENGE 1\n+//\n+// Write a function named firstLetters that takes in an array of strings and returns an array\n+// containing only the first letter of each string.\n+//\n+// For example, ['this is great :)', 'wow', 'whyyyyyy :(', ':)))))'] returns ['t', 'w', 'w', ':'].\n+// ------------------------------------------------------------------------------------------------\n+\n+const firstLetters = (strs) => {\n+  return strs.map(str => str.charAt(0));\n+};\n+\n+// ------------------------------------------------------------------------------------------------\n+// CHALLENGE 2\n+//\n+// Write a function named findHappiness that takes in an array of strings and returns an array\n+// containing only the strings from the input array that contain \":)\".\n+// e.g. ['this is great :)', 'wow', 'whyyyyyy :(', ':)))))'] => ['this is great :)', ':)))))']\n+// ------------------------------------------------------------------------------------------------\n+\n+const findHappiness = (strs) => {\n+  return strs.filter(str => str.includes(':)'));\n+};\n+\n+// ------------------------------------------------------------------------------------------------\n+// CHALLENGE 3\n+//\n+// Write a function named standardizePhoneNumbers that takes in an array of phone number strings in\n+// (XXX) XXX-XXXX format, and returns an array with the phone number strings in XXXXXXXXXX format.\n+// ------------------------------------------------------------------------------------------------\n+\n+const standardizePhoneNumbers = (phoneNumbers) => {\n+  return phoneNumbers.map(num => num.substring(1, 4) + num.substring(6, 9) + num.substring(10, num.length));\n+};\n+\n+// ------------------------------------------------------------------------------------------------\n+// CHALLENGE 4\n+//\n+// Write a function named onlyOddChars that takes in a string and returns only the odd-index\n+// characters from that string.\n+// ------------------------------------------------------------------------------------------------\n+\n+const onlyOddChars = (str) => {\n+  let answer = '';\n+  for(let i=1; i < str.length; i += 2){\n+    answer += str[i];\n+  }\n+  return answer;\n+};\n+\n+// ------------------------------------------------------------------------------------------------\n+// CHALLENGE 5\n+//\n+// Write a function named allHappy that takes in an array of strings and returns a boolean, indicating\n+// whether all those strings contain \":)\".\n+// ------------------------------------------------------------------------------------------------\n+\n+const allHappy = (strs) => {\n+  return strs.every(str => str.includes(':)'));\n+};\n+\n+// ------------------------------------------------------------------------------------------------\n+// CHALLENGE 6\n+//\n+// Write a function named findAnything that takes in an array of strings, along with a target string.\n+// Return an array containing only those strings from the original array that contain the target string.\n+// ------------------------------------------------------------------------------------------------\n+\n+const findAnything = (strs, target) => {\n+  return strs.filter(str => str.includes(target));\n+};\n+\n+// ------------------------------------------------------------------------------------------------\n+// CHALLENGE 7\n+//\n+// Write a function named allAnything that takes in an array of strings, along with a target string.\n+// Return a boolean based on whether or not every string in the array contains the target string.\n+// ------------------------------------------------------------------------------------------------\n+\n+const allAnything = (strs, target) => {\n+  return strs.every(str => str.includes(target));\n+};\n+\n+// ------------------------------------------------------------------------------------------------\n+// CHALLENGE 8\n+//\n+// We've been testing a new course enrollment system, and we think we have the bugs worked out, but\n+// in the meantime, Brook enrolled himself in a bunch of different classes to test if it was working.\n+//\n+// Write a function named unenrollBrook that takes in a 2d array where each array represents\n+// one course's roster, and is an array of strings of the names of the people in that course.\n+// Return a 2d array with the same roster, but where anyone whose name includes Brook\n+// is removed from every course.\n+// ------------------------------------------------------------------------------------------------\n+\n+const unenrollBrook = (roster) => {\n+  return roster.map(course => course.filter(person => !person.includes('Brook')));\n+};\n+\n+// ------------------------------------------------------------------------------------------------\n+// CHALLENGE 9\n+//\n+// Write a function named sortByDay that takes in an array of strings, each of which represents an\n+// event's day and time.\n+//\n+// Return a 2d array that organizes those strings based on the day they happen.\n+// For example, all Monday's events are in the first array, all Tuesday's are in the second, etc.\n+//\n+// If an event takes place on multiple days (i.e. \"Dancing on Mondays and Tuesdays\"), it should\n+// appear in both arrays.\n+// ------------------------------------------------------------------------------------------------\n+\n+const daysOfWeek = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];\n+\n+const sortByDay = (eventStrings) => {\n+  return daysOfWeek.reduce((ans, day) => {\n+    let events = [];\n+    eventStrings.forEach((event) => {","path":"includes/challenge-13.test.js","position":122,"original_position":122,"commit_id":"a6a8356b8cf92bb5c0055c8cda9be3a8e0bec2cf","original_commit_id":"a6a8356b8cf92bb5c0055c8cda9be3a8e0bec2cf","user":{"login":"zarkle","id":31747859,"node_id":"MDQ6VXNlcjMxNzQ3ODU5","avatar_url":"https://avatars1.githubusercontent.com/u/31747859?v=4","gravatar_id":"","url":"https://api.github.com/users/zarkle","html_url":"https://github.com/zarkle","followers_url":"https://api.github.com/users/zarkle/followers","following_url":"https://api.github.com/users/zarkle/following{/other_user}","gists_url":"https://api.github.com/users/zarkle/gists{/gist_id}","starred_url":"https://api.github.com/users/zarkle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zarkle/subscriptions","organizations_url":"https://api.github.com/users/zarkle/orgs","repos_url":"https://api.github.com/users/zarkle/repos","events_url":"https://api.github.com/users/zarkle/events{/privacy}","received_events_url":"https://api.github.com/users/zarkle/received_events","type":"User","site_admin":false},"body":"your `forEach` with an `if` is basically a `filter()`","created_at":"2018-09-20T17:46:08Z","updated_at":"2018-09-20T17:46:08Z","html_url":"https://github.com/ellisken/code-challenges/pull/13#discussion_r219257325","pull_request_url":"https://api.github.com/repos/ellisken/code-challenges/pulls/13","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/ellisken/code-challenges/pulls/comments/219257325"},"html":{"href":"https://github.com/ellisken/code-challenges/pull/13#discussion_r219257325"},"pull_request":{"href":"https://api.github.com/repos/ellisken/code-challenges/pulls/13"}}},"pull_request":{"url":"https://api.github.com/repos/ellisken/code-challenges/pulls/13","id":216832749,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE2ODMyNzQ5","html_url":"https://github.com/ellisken/code-challenges/pull/13","diff_url":"https://github.com/ellisken/code-challenges/pull/13.diff","patch_url":"https://github.com/ellisken/code-challenges/pull/13.patch","issue_url":"https://api.github.com/repos/ellisken/code-challenges/issues/13","number":13,"state":"open","locked":false,"title":"Wednesday","user":{"login":"ellisken","id":22351113,"node_id":"MDQ6VXNlcjIyMzUxMTEz","avatar_url":"https://avatars1.githubusercontent.com/u/22351113?v=4","gravatar_id":"","url":"https://api.github.com/users/ellisken","html_url":"https://github.com/ellisken","followers_url":"https://api.github.com/users/ellisken/followers","following_url":"https://api.github.com/users/ellisken/following{/other_user}","gists_url":"https://api.github.com/users/ellisken/gists{/gist_id}","starred_url":"https://api.github.com/users/ellisken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ellisken/subscriptions","organizations_url":"https://api.github.com/users/ellisken/orgs","repos_url":"https://api.github.com/users/ellisken/repos","events_url":"https://api.github.com/users/ellisken/events{/privacy}","received_events_url":"https://api.github.com/users/ellisken/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-09-20T03:13:28Z","updated_at":"2018-09-20T17:46:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b638f6a1b5116d5b694dc61396db1889429eee9d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ellisken/code-challenges/pulls/13/commits","review_comments_url":"https://api.github.com/repos/ellisken/code-challenges/pulls/13/comments","review_comment_url":"https://api.github.com/repos/ellisken/code-challenges/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ellisken/code-challenges/issues/13/comments","statuses_url":"https://api.github.com/repos/ellisken/code-challenges/statuses/a6a8356b8cf92bb5c0055c8cda9be3a8e0bec2cf","head":{"label":"ellisken:wednesday","ref":"wednesday","sha":"a6a8356b8cf92bb5c0055c8cda9be3a8e0bec2cf","user":{"login":"ellisken","id":22351113,"node_id":"MDQ6VXNlcjIyMzUxMTEz","avatar_url":"https://avatars1.githubusercontent.com/u/22351113?v=4","gravatar_id":"","url":"https://api.github.com/users/ellisken","html_url":"https://github.com/ellisken","followers_url":"https://api.github.com/users/ellisken/followers","following_url":"https://api.github.com/users/ellisken/following{/other_user}","gists_url":"https://api.github.com/users/ellisken/gists{/gist_id}","starred_url":"https://api.github.com/users/ellisken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ellisken/subscriptions","organizations_url":"https://api.github.com/users/ellisken/orgs","repos_url":"https://api.github.com/users/ellisken/repos","events_url":"https://api.github.com/users/ellisken/events{/privacy}","received_events_url":"https://api.github.com/users/ellisken/received_events","type":"User","site_admin":false},"repo":{"id":147392812,"node_id":"MDEwOlJlcG9zaXRvcnkxNDczOTI4MTI=","name":"code-challenges","full_name":"ellisken/code-challenges","private":false,"owner":{"login":"ellisken","id":22351113,"node_id":"MDQ6VXNlcjIyMzUxMTEz","avatar_url":"https://avatars1.githubusercontent.com/u/22351113?v=4","gravatar_id":"","url":"https://api.github.com/users/ellisken","html_url":"https://github.com/ellisken","followers_url":"https://api.github.com/users/ellisken/followers","following_url":"https://api.github.com/users/ellisken/following{/other_user}","gists_url":"https://api.github.com/users/ellisken/gists{/gist_id}","starred_url":"https://api.github.com/users/ellisken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ellisken/subscriptions","organizations_url":"https://api.github.com/users/ellisken/orgs","repos_url":"https://api.github.com/users/ellisken/repos","events_url":"https://api.github.com/users/ellisken/events{/privacy}","received_events_url":"https://api.github.com/users/ellisken/received_events","type":"User","site_admin":false},"html_url":"https://github.com/ellisken/code-challenges","description":"Code 301 coding challenge work","fork":false,"url":"https://api.github.com/repos/ellisken/code-challenges","forks_url":"https://api.github.com/repos/ellisken/code-challenges/forks","keys_url":"https://api.github.com/repos/ellisken/code-challenges/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ellisken/code-challenges/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ellisken/code-challenges/teams","hooks_url":"https://api.github.com/repos/ellisken/code-challenges/hooks","issue_events_url":"https://api.github.com/repos/ellisken/code-challenges/issues/events{/number}","events_url":"https://api.github.com/repos/ellisken/code-challenges/events","assignees_url":"https://api.github.com/repos/ellisken/code-challenges/assignees{/user}","branches_url":"https://api.github.com/repos/ellisken/code-challenges/branches{/branch}","tags_url":"https://api.github.com/repos/ellisken/code-challenges/tags","blobs_url":"https://api.github.com/repos/ellisken/code-challenges/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ellisken/code-challenges/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ellisken/code-challenges/git/refs{/sha}","trees_url":"https://api.github.com/repos/ellisken/code-challenges/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ellisken/code-challenges/statuses/{sha}","languages_url":"https://api.github.com/repos/ellisken/code-challenges/languages","stargazers_url":"https://api.github.com/repos/ellisken/code-challenges/stargazers","contributors_url":"https://api.github.com/repos/ellisken/code-challenges/contributors","subscribers_url":"https://api.github.com/repos/ellisken/code-challenges/subscribers","subscription_url":"https://api.github.com/repos/ellisken/code-challenges/subscription","commits_url":"https://api.github.com/repos/ellisken/code-challenges/commits{/sha}","git_commits_url":"https://api.github.com/repos/ellisken/code-challenges/git/commits{/sha}","comments_url":"https://api.github.com/repos/ellisken/code-challenges/comments{/number}","issue_comment_url":"https://api.github.com/repos/ellisken/code-challenges/issues/comments{/number}","contents_url":"https://api.github.com/repos/ellisken/code-challenges/contents/{+path}","compare_url":"https://api.github.com/repos/ellisken/code-challenges/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ellisken/code-challenges/merges","archive_url":"https://api.github.com/repos/ellisken/code-challenges/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ellisken/code-challenges/downloads","issues_url":"https://api.github.com/repos/ellisken/code-challenges/issues{/number}","pulls_url":"https://api.github.com/repos/ellisken/code-challenges/pulls{/number}","milestones_url":"https://api.github.com/repos/ellisken/code-challenges/milestones{/number}","notifications_url":"https://api.github.com/repos/ellisken/code-challenges/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ellisken/code-challenges/labels{/name}","releases_url":"https://api.github.com/repos/ellisken/code-challenges/releases{/id}","deployments_url":"https://api.github.com/repos/ellisken/code-challenges/deployments","created_at":"2018-09-04T18:41:15Z","updated_at":"2018-09-19T18:40:17Z","pushed_at":"2018-09-20T03:13:29Z","git_url":"git://github.com/ellisken/code-challenges.git","ssh_url":"git@github.com:ellisken/code-challenges.git","clone_url":"https://github.com/ellisken/code-challenges.git","svn_url":"https://github.com/ellisken/code-challenges","homepage":null,"size":81,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"ellisken:master","ref":"master","sha":"134df56b796021932138839b668f3b2c2d5e8bda","user":{"login":"ellisken","id":22351113,"node_id":"MDQ6VXNlcjIyMzUxMTEz","avatar_url":"https://avatars1.githubusercontent.com/u/22351113?v=4","gravatar_id":"","url":"https://api.github.com/users/ellisken","html_url":"https://github.com/ellisken","followers_url":"https://api.github.com/users/ellisken/followers","following_url":"https://api.github.com/users/ellisken/following{/other_user}","gists_url":"https://api.github.com/users/ellisken/gists{/gist_id}","starred_url":"https://api.github.com/users/ellisken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ellisken/subscriptions","organizations_url":"https://api.github.com/users/ellisken/orgs","repos_url":"https://api.github.com/users/ellisken/repos","events_url":"https://api.github.com/users/ellisken/events{/privacy}","received_events_url":"https://api.github.com/users/ellisken/received_events","type":"User","site_admin":false},"repo":{"id":147392812,"node_id":"MDEwOlJlcG9zaXRvcnkxNDczOTI4MTI=","name":"code-challenges","full_name":"ellisken/code-challenges","private":false,"owner":{"login":"ellisken","id":22351113,"node_id":"MDQ6VXNlcjIyMzUxMTEz","avatar_url":"https://avatars1.githubusercontent.com/u/22351113?v=4","gravatar_id":"","url":"https://api.github.com/users/ellisken","html_url":"https://github.com/ellisken","followers_url":"https://api.github.com/users/ellisken/followers","following_url":"https://api.github.com/users/ellisken/following{/other_user}","gists_url":"https://api.github.com/users/ellisken/gists{/gist_id}","starred_url":"https://api.github.com/users/ellisken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ellisken/subscriptions","organizations_url":"https://api.github.com/users/ellisken/orgs","repos_url":"https://api.github.com/users/ellisken/repos","events_url":"https://api.github.com/users/ellisken/events{/privacy}","received_events_url":"https://api.github.com/users/ellisken/received_events","type":"User","site_admin":false},"html_url":"https://github.com/ellisken/code-challenges","description":"Code 301 coding challenge work","fork":false,"url":"https://api.github.com/repos/ellisken/code-challenges","forks_url":"https://api.github.com/repos/ellisken/code-challenges/forks","keys_url":"https://api.github.com/repos/ellisken/code-challenges/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ellisken/code-challenges/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ellisken/code-challenges/teams","hooks_url":"https://api.github.com/repos/ellisken/code-challenges/hooks","issue_events_url":"https://api.github.com/repos/ellisken/code-challenges/issues/events{/number}","events_url":"https://api.github.com/repos/ellisken/code-challenges/events","assignees_url":"https://api.github.com/repos/ellisken/code-challenges/assignees{/user}","branches_url":"https://api.github.com/repos/ellisken/code-challenges/branches{/branch}","tags_url":"https://api.github.com/repos/ellisken/code-challenges/tags","blobs_url":"https://api.github.com/repos/ellisken/code-challenges/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ellisken/code-challenges/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ellisken/code-challenges/git/refs{/sha}","trees_url":"https://api.github.com/repos/ellisken/code-challenges/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ellisken/code-challenges/statuses/{sha}","languages_url":"https://api.github.com/repos/ellisken/code-challenges/languages","stargazers_url":"https://api.github.com/repos/ellisken/code-challenges/stargazers","contributors_url":"https://api.github.com/repos/ellisken/code-challenges/contributors","subscribers_url":"https://api.github.com/repos/ellisken/code-challenges/subscribers","subscription_url":"https://api.github.com/repos/ellisken/code-challenges/subscription","commits_url":"https://api.github.com/repos/ellisken/code-challenges/commits{/sha}","git_commits_url":"https://api.github.com/repos/ellisken/code-challenges/git/commits{/sha}","comments_url":"https://api.github.com/repos/ellisken/code-challenges/comments{/number}","issue_comment_url":"https://api.github.com/repos/ellisken/code-challenges/issues/comments{/number}","contents_url":"https://api.github.com/repos/ellisken/code-challenges/contents/{+path}","compare_url":"https://api.github.com/repos/ellisken/code-challenges/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ellisken/code-challenges/merges","archive_url":"https://api.github.com/repos/ellisken/code-challenges/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ellisken/code-challenges/downloads","issues_url":"https://api.github.com/repos/ellisken/code-challenges/issues{/number}","pulls_url":"https://api.github.com/repos/ellisken/code-challenges/pulls{/number}","milestones_url":"https://api.github.com/repos/ellisken/code-challenges/milestones{/number}","notifications_url":"https://api.github.com/repos/ellisken/code-challenges/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ellisken/code-challenges/labels{/name}","releases_url":"https://api.github.com/repos/ellisken/code-challenges/releases{/id}","deployments_url":"https://api.github.com/repos/ellisken/code-challenges/deployments","created_at":"2018-09-04T18:41:15Z","updated_at":"2018-09-19T18:40:17Z","pushed_at":"2018-09-20T03:13:29Z","git_url":"git://github.com/ellisken/code-challenges.git","ssh_url":"git@github.com:ellisken/code-challenges.git","clone_url":"https://github.com/ellisken/code-challenges.git","svn_url":"https://github.com/ellisken/code-challenges","homepage":null,"size":81,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ellisken/code-challenges/pulls/13"},"html":{"href":"https://github.com/ellisken/code-challenges/pull/13"},"issue":{"href":"https://api.github.com/repos/ellisken/code-challenges/issues/13"},"comments":{"href":"https://api.github.com/repos/ellisken/code-challenges/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/ellisken/code-challenges/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/ellisken/code-challenges/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ellisken/code-challenges/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/ellisken/code-challenges/statuses/a6a8356b8cf92bb5c0055c8cda9be3a8e0bec2cf"}},"author_association":"OWNER"}}
{"actor":{"display_login":"zarkle"}}