{"action":"created","comment":{"url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/pulls/comments/44836432","id":44836432,"diff_hunk":"@@ -0,0 +1,207 @@\n+// This is a one line comment\n+\n+//Created a function that takes a string and return the first character\n+\n+function firstCharacter(string){\n+    return string.charAt(0);\n+}\n+firstCharacter('hello');\n+\n+//Created a function that takes a string and returns the last character \n+\n+function lastCharacter(string){\n+    return string.charAt(string.length -1);\n+}\n+lastCharacter('hello');\n+\n+\n+//Created a function that takes a number and string and returns the letter at the postion specified by the number\n+//Indexing starts at 0\n+//This will return \"r\" which is the 4th letter given that indexing starts from 0 '0,1,2,3'\n+\n+function positionString(position, string){\n+    return string.charAt(position + 1);\n+}\n+\n+positionString(3, 'montreal');\n+\n+//A function that adds two number or concatenates two strings or one string and a number\n+\n+function add(a, b){\n+    return a + b;\n+}\n+add(2, 4);\n+add(\"f\",\"g\")\n+\n+//A function that multiplies numbers. If numbers are not passed NaN is returned\n+\n+\n+function multiply(a, b){\n+    return a * b;\n+}\n+\n+multiply(2,4);\n+//This will return NaN\n+multiply('a','b');\n+\n+//A function that takes two numbers and runs an operation based on the third parameter\n+\n+function calculate(num1, num2, operation){\n+    if(operation === 'add'){\n+        return num1 + num2;\n+    } else if(operation === 'subtract'){\n+        return num1 - num2;\n+    } else if(operation === 'mult'){\n+        return num1 * num2;\n+    } else if(operation === 'div'){\n+        return num1/num2;\n+    } else {\n+        return 0;\n+    }\n+}\n+\n+calculate(1,2, 'add');\n+","path":"answers.js","position":64,"original_position":64,"commit_id":"fb4f1fa5252a218702cdf9f6a23aede55db640cd","original_commit_id":"fb4f1fa5252a218702cdf9f6a23aede55db640cd","user":{"login":"noratop","id":9258865,"avatar_url":"https://avatars.githubusercontent.com/u/9258865?v=3","gravatar_id":"","url":"https://api.github.com/users/noratop","html_url":"https://github.com/noratop","followers_url":"https://api.github.com/users/noratop/followers","following_url":"https://api.github.com/users/noratop/following{/other_user}","gists_url":"https://api.github.com/users/noratop/gists{/gist_id}","starred_url":"https://api.github.com/users/noratop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noratop/subscriptions","organizations_url":"https://api.github.com/users/noratop/orgs","repos_url":"https://api.github.com/users/noratop/repos","events_url":"https://api.github.com/users/noratop/events{/privacy}","received_events_url":"https://api.github.com/users/noratop/received_events","type":"User","site_admin":false},"body":"@dcodus :100: ","created_at":"2015-11-13T21:30:38Z","updated_at":"2015-11-13T21:30:38Z","html_url":"https://github.com/DecodeMTL/basic-javascript-workshop/pull/5#discussion_r44836432","pull_request_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/pulls/comments/44836432"},"html":{"href":"https://github.com/DecodeMTL/basic-javascript-workshop/pull/5#discussion_r44836432"},"pull_request":{"href":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/pulls/5","id":50674710,"html_url":"https://github.com/DecodeMTL/basic-javascript-workshop/pull/5","diff_url":"https://github.com/DecodeMTL/basic-javascript-workshop/pull/5.diff","patch_url":"https://github.com/DecodeMTL/basic-javascript-workshop/pull/5.patch","issue_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/issues/5","number":5,"state":"open","locked":false,"title":"Created answers.js and added a one line comment","user":{"login":"dcodus","id":12925816,"avatar_url":"https://avatars.githubusercontent.com/u/12925816?v=3","gravatar_id":"","url":"https://api.github.com/users/dcodus","html_url":"https://github.com/dcodus","followers_url":"https://api.github.com/users/dcodus/followers","following_url":"https://api.github.com/users/dcodus/following{/other_user}","gists_url":"https://api.github.com/users/dcodus/gists{/gist_id}","starred_url":"https://api.github.com/users/dcodus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcodus/subscriptions","organizations_url":"https://api.github.com/users/dcodus/orgs","repos_url":"https://api.github.com/users/dcodus/repos","events_url":"https://api.github.com/users/dcodus/events{/privacy}","received_events_url":"https://api.github.com/users/dcodus/received_events","type":"User","site_admin":false},"body":"Used touch to create the file.\r\nUsed // to add the comment","created_at":"2015-11-13T18:30:47Z","updated_at":"2015-11-13T21:30:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"731a42efb221776e01e6a02296b19eaff5393340","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/pulls/5/commits","review_comments_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/pulls/5/comments","review_comment_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/issues/5/comments","statuses_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/statuses/fb4f1fa5252a218702cdf9f6a23aede55db640cd","head":{"label":"dcodus:functions","ref":"functions","sha":"fb4f1fa5252a218702cdf9f6a23aede55db640cd","user":{"login":"dcodus","id":12925816,"avatar_url":"https://avatars.githubusercontent.com/u/12925816?v=3","gravatar_id":"","url":"https://api.github.com/users/dcodus","html_url":"https://github.com/dcodus","followers_url":"https://api.github.com/users/dcodus/followers","following_url":"https://api.github.com/users/dcodus/following{/other_user}","gists_url":"https://api.github.com/users/dcodus/gists{/gist_id}","starred_url":"https://api.github.com/users/dcodus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcodus/subscriptions","organizations_url":"https://api.github.com/users/dcodus/orgs","repos_url":"https://api.github.com/users/dcodus/repos","events_url":"https://api.github.com/users/dcodus/events{/privacy}","received_events_url":"https://api.github.com/users/dcodus/received_events","type":"User","site_admin":false},"repo":{"id":46139666,"name":"basic-javascript-workshop","full_name":"dcodus/basic-javascript-workshop","owner":{"login":"dcodus","id":12925816,"avatar_url":"https://avatars.githubusercontent.com/u/12925816?v=3","gravatar_id":"","url":"https://api.github.com/users/dcodus","html_url":"https://github.com/dcodus","followers_url":"https://api.github.com/users/dcodus/followers","following_url":"https://api.github.com/users/dcodus/following{/other_user}","gists_url":"https://api.github.com/users/dcodus/gists{/gist_id}","starred_url":"https://api.github.com/users/dcodus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcodus/subscriptions","organizations_url":"https://api.github.com/users/dcodus/orgs","repos_url":"https://api.github.com/users/dcodus/repos","events_url":"https://api.github.com/users/dcodus/events{/privacy}","received_events_url":"https://api.github.com/users/dcodus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dcodus/basic-javascript-workshop","description":"Basic Javascript Workshop","fork":true,"url":"https://api.github.com/repos/dcodus/basic-javascript-workshop","forks_url":"https://api.github.com/repos/dcodus/basic-javascript-workshop/forks","keys_url":"https://api.github.com/repos/dcodus/basic-javascript-workshop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dcodus/basic-javascript-workshop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dcodus/basic-javascript-workshop/teams","hooks_url":"https://api.github.com/repos/dcodus/basic-javascript-workshop/hooks","issue_events_url":"https://api.github.com/repos/dcodus/basic-javascript-workshop/issues/events{/number}","events_url":"https://api.github.com/repos/dcodus/basic-javascript-workshop/events","assignees_url":"https://api.github.com/repos/dcodus/basic-javascript-workshop/assignees{/user}","branches_url":"https://api.github.com/repos/dcodus/basic-javascript-workshop/branches{/branch}","tags_url":"https://api.github.com/repos/dcodus/basic-javascript-workshop/tags","blobs_url":"https://api.github.com/repos/dcodus/basic-javascript-workshop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dcodus/basic-javascript-workshop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dcodus/basic-javascript-workshop/git/refs{/sha}","trees_url":"https://api.github.com/repos/dcodus/basic-javascript-workshop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dcodus/basic-javascript-workshop/statuses/{sha}","languages_url":"https://api.github.com/repos/dcodus/basic-javascript-workshop/languages","stargazers_url":"https://api.github.com/repos/dcodus/basic-javascript-workshop/stargazers","contributors_url":"https://api.github.com/repos/dcodus/basic-javascript-workshop/contributors","subscribers_url":"https://api.github.com/repos/dcodus/basic-javascript-workshop/subscribers","subscription_url":"https://api.github.com/repos/dcodus/basic-javascript-workshop/subscription","commits_url":"https://api.github.com/repos/dcodus/basic-javascript-workshop/commits{/sha}","git_commits_url":"https://api.github.com/repos/dcodus/basic-javascript-workshop/git/commits{/sha}","comments_url":"https://api.github.com/repos/dcodus/basic-javascript-workshop/comments{/number}","issue_comment_url":"https://api.github.com/repos/dcodus/basic-javascript-workshop/issues/comments{/number}","contents_url":"https://api.github.com/repos/dcodus/basic-javascript-workshop/contents/{+path}","compare_url":"https://api.github.com/repos/dcodus/basic-javascript-workshop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dcodus/basic-javascript-workshop/merges","archive_url":"https://api.github.com/repos/dcodus/basic-javascript-workshop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dcodus/basic-javascript-workshop/downloads","issues_url":"https://api.github.com/repos/dcodus/basic-javascript-workshop/issues{/number}","pulls_url":"https://api.github.com/repos/dcodus/basic-javascript-workshop/pulls{/number}","milestones_url":"https://api.github.com/repos/dcodus/basic-javascript-workshop/milestones{/number}","notifications_url":"https://api.github.com/repos/dcodus/basic-javascript-workshop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dcodus/basic-javascript-workshop/labels{/name}","releases_url":"https://api.github.com/repos/dcodus/basic-javascript-workshop/releases{/id}","created_at":"2015-11-13T18:26:23Z","updated_at":"2015-09-15T21:04:44Z","pushed_at":"2015-11-13T21:13:14Z","git_url":"git://github.com/dcodus/basic-javascript-workshop.git","ssh_url":"git@github.com:dcodus/basic-javascript-workshop.git","clone_url":"https://github.com/dcodus/basic-javascript-workshop.git","svn_url":"https://github.com/dcodus/basic-javascript-workshop","homepage":"http://www.decodemtl.com","size":564,"stargazers_count":0,"watchers_count":0,"language":null,"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":"DecodeMTL:master","ref":"master","sha":"f736fe4addc814ce7a6b0b503ba9d41972c091be","user":{"login":"DecodeMTL","id":14301039,"avatar_url":"https://avatars.githubusercontent.com/u/14301039?v=3","gravatar_id":"","url":"https://api.github.com/users/DecodeMTL","html_url":"https://github.com/DecodeMTL","followers_url":"https://api.github.com/users/DecodeMTL/followers","following_url":"https://api.github.com/users/DecodeMTL/following{/other_user}","gists_url":"https://api.github.com/users/DecodeMTL/gists{/gist_id}","starred_url":"https://api.github.com/users/DecodeMTL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DecodeMTL/subscriptions","organizations_url":"https://api.github.com/users/DecodeMTL/orgs","repos_url":"https://api.github.com/users/DecodeMTL/repos","events_url":"https://api.github.com/users/DecodeMTL/events{/privacy}","received_events_url":"https://api.github.com/users/DecodeMTL/received_events","type":"Organization","site_admin":false},"repo":{"id":42325184,"name":"basic-javascript-workshop","full_name":"DecodeMTL/basic-javascript-workshop","owner":{"login":"DecodeMTL","id":14301039,"avatar_url":"https://avatars.githubusercontent.com/u/14301039?v=3","gravatar_id":"","url":"https://api.github.com/users/DecodeMTL","html_url":"https://github.com/DecodeMTL","followers_url":"https://api.github.com/users/DecodeMTL/followers","following_url":"https://api.github.com/users/DecodeMTL/following{/other_user}","gists_url":"https://api.github.com/users/DecodeMTL/gists{/gist_id}","starred_url":"https://api.github.com/users/DecodeMTL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DecodeMTL/subscriptions","organizations_url":"https://api.github.com/users/DecodeMTL/orgs","repos_url":"https://api.github.com/users/DecodeMTL/repos","events_url":"https://api.github.com/users/DecodeMTL/events{/privacy}","received_events_url":"https://api.github.com/users/DecodeMTL/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DecodeMTL/basic-javascript-workshop","description":"Basic Javascript Workshop","fork":false,"url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop","forks_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/forks","keys_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/teams","hooks_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/hooks","issue_events_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/issues/events{/number}","events_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/events","assignees_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/assignees{/user}","branches_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/branches{/branch}","tags_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/tags","blobs_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/git/refs{/sha}","trees_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/statuses/{sha}","languages_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/languages","stargazers_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/stargazers","contributors_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/contributors","subscribers_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/subscribers","subscription_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/subscription","commits_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/commits{/sha}","git_commits_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/git/commits{/sha}","comments_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/comments{/number}","issue_comment_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/issues/comments{/number}","contents_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/contents/{+path}","compare_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/merges","archive_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/downloads","issues_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/issues{/number}","pulls_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/pulls{/number}","milestones_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/milestones{/number}","notifications_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/labels{/name}","releases_url":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/releases{/id}","created_at":"2015-09-11T18:22:56Z","updated_at":"2015-09-15T21:04:44Z","pushed_at":"2015-11-13T21:29:10Z","git_url":"git://github.com/DecodeMTL/basic-javascript-workshop.git","ssh_url":"git@github.com:DecodeMTL/basic-javascript-workshop.git","clone_url":"https://github.com/DecodeMTL/basic-javascript-workshop.git","svn_url":"https://github.com/DecodeMTL/basic-javascript-workshop","homepage":"http://www.decodemtl.com","size":564,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":10,"forks":11,"open_issues":10,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/pulls/5"},"html":{"href":"https://github.com/DecodeMTL/basic-javascript-workshop/pull/5"},"issue":{"href":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/issues/5"},"comments":{"href":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/DecodeMTL/basic-javascript-workshop/statuses/fb4f1fa5252a218702cdf9f6a23aede55db640cd"}}}}