{"action":"created","comment":{"url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/pulls/comments/92059191","pull_request_review_id":12569180,"id":92059191,"diff_hunk":"@@ -0,0 +1,66 @@\n+console.log('holla from js');\n+\n+var expenseName = document.forms[0].querySelector('input[name=\"expense-name\"]');\n+var expenseAmount = document.forms[0].querySelector('input[name=\"expense-amount\"]');\n+var expenseTableHead = document.querySelector('.expenses').children[0];\n+var expenseTableBody = document.querySelector('.expenses').children[1];\n+var inputForm = document.querySelector('.inputForm');\n+var pressButton = document.querySelector('#add-expense');\n+var totalExpense = document.querySelector('.expense-total');\n+// var tableArr = [];\n+\n+var handleClick = function(evt) {\n+  //gaurd against blank rows\n+  if (expenseName.value === '' || expenseAmount.value === '') {\n+    //broken error message next to button\n+    // var error = document.createElement('p')\n+    // error.textContent = 'Blank expenses, scrub?'\n+    // inputForm.appendChild(error);\n+    alert('Enter your expenses, scrub');\n+  } else {\n+  //create new table row\n+    var newRow = document.createElement('tr');\n+    newRow.innerHTML = '<td>' + expenseName.value + '</td><td>' + expenseAmount.value + '</td><button class=\"deleteButton\" type=\"button\">Delete</button></td>';\n+    expenseTableBody.appendChild(newRow);\n+    //push rows as objects to tableArr\n+    tableArr = [];\n+    for (var i = 0; i < expenseTableBody.rows.length; i++){\n+      tableArr.push({","path":"main.js","position":28,"original_position":28,"commit_id":"124b3ca8ed6b8f85ef9291ce588aaef4693942f8","original_commit_id":"124b3ca8ed6b8f85ef9291ce588aaef4693942f8","user":{"login":"phlco","id":1198291,"avatar_url":"https://avatars.githubusercontent.com/u/1198291?v=3","gravatar_id":"","url":"https://api.github.com/users/phlco","html_url":"https://github.com/phlco","followers_url":"https://api.github.com/users/phlco/followers","following_url":"https://api.github.com/users/phlco/following{/other_user}","gists_url":"https://api.github.com/users/phlco/gists{/gist_id}","starred_url":"https://api.github.com/users/phlco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phlco/subscriptions","organizations_url":"https://api.github.com/users/phlco/orgs","repos_url":"https://api.github.com/users/phlco/repos","events_url":"https://api.github.com/users/phlco/events{/privacy}","received_events_url":"https://api.github.com/users/phlco/received_events","type":"User","site_admin":false},"body":"It's cleaner to just use the `expenseName.value` and expenseAmount.value` that you already have above before you stick it in the DOM.","created_at":"2016-12-12T22:48:44Z","updated_at":"2016-12-12T22:48:44Z","html_url":"https://github.com/WDI-DTLA-41/lab-w02d03-js-expense-tracker/pull/16#discussion_r92059191","pull_request_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/pulls/16","_links":{"self":{"href":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/pulls/comments/92059191"},"html":{"href":"https://github.com/WDI-DTLA-41/lab-w02d03-js-expense-tracker/pull/16#discussion_r92059191"},"pull_request":{"href":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/pulls/16","id":97179428,"html_url":"https://github.com/WDI-DTLA-41/lab-w02d03-js-expense-tracker/pull/16","diff_url":"https://github.com/WDI-DTLA-41/lab-w02d03-js-expense-tracker/pull/16.diff","patch_url":"https://github.com/WDI-DTLA-41/lab-w02d03-js-expense-tracker/pull/16.patch","issue_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/issues/16","number":16,"state":"open","locked":false,"title":"finishes everything but sort, removes online copy paste sort code","user":{"login":"amaidah","id":16659483,"avatar_url":"https://avatars.githubusercontent.com/u/16659483?v=3","gravatar_id":"","url":"https://api.github.com/users/amaidah","html_url":"https://github.com/amaidah","followers_url":"https://api.github.com/users/amaidah/followers","following_url":"https://api.github.com/users/amaidah/following{/other_user}","gists_url":"https://api.github.com/users/amaidah/gists{/gist_id}","starred_url":"https://api.github.com/users/amaidah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amaidah/subscriptions","organizations_url":"https://api.github.com/users/amaidah/orgs","repos_url":"https://api.github.com/users/amaidah/repos","events_url":"https://api.github.com/users/amaidah/events{/privacy}","received_events_url":"https://api.github.com/users/amaidah/received_events","type":"User","site_admin":false},"body":"In order to make an expense counter, I had to clear the existing array every time on line 26. This definitely does not seem to be the most efficient way as my code is recalculating the total expense calculation every time.\r\n\r\nAlso, sorting is very tough. Had it working by copy/paste online code but removed it as didn't understand a thing. \r\n\r\nCurrently, I am working through turning the table into an array objects on  click which is then sorted and re-displayed as a new table. Is this the correct logical method?","created_at":"2016-12-08T18:55:23Z","updated_at":"2016-12-12T22:48:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2187d88061c6fa8558845639b513633b42433094","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/pulls/16/commits","review_comments_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/pulls/16/comments","review_comment_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/issues/16/comments","statuses_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/statuses/124b3ca8ed6b8f85ef9291ce588aaef4693942f8","head":{"label":"amaidah:master","ref":"master","sha":"124b3ca8ed6b8f85ef9291ce588aaef4693942f8","user":{"login":"amaidah","id":16659483,"avatar_url":"https://avatars.githubusercontent.com/u/16659483?v=3","gravatar_id":"","url":"https://api.github.com/users/amaidah","html_url":"https://github.com/amaidah","followers_url":"https://api.github.com/users/amaidah/followers","following_url":"https://api.github.com/users/amaidah/following{/other_user}","gists_url":"https://api.github.com/users/amaidah/gists{/gist_id}","starred_url":"https://api.github.com/users/amaidah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amaidah/subscriptions","organizations_url":"https://api.github.com/users/amaidah/orgs","repos_url":"https://api.github.com/users/amaidah/repos","events_url":"https://api.github.com/users/amaidah/events{/privacy}","received_events_url":"https://api.github.com/users/amaidah/received_events","type":"User","site_admin":false},"repo":{"id":75880771,"name":"lab-w02d03-js-expense-tracker","full_name":"amaidah/lab-w02d03-js-expense-tracker","owner":{"login":"amaidah","id":16659483,"avatar_url":"https://avatars.githubusercontent.com/u/16659483?v=3","gravatar_id":"","url":"https://api.github.com/users/amaidah","html_url":"https://github.com/amaidah","followers_url":"https://api.github.com/users/amaidah/followers","following_url":"https://api.github.com/users/amaidah/following{/other_user}","gists_url":"https://api.github.com/users/amaidah/gists{/gist_id}","starred_url":"https://api.github.com/users/amaidah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amaidah/subscriptions","organizations_url":"https://api.github.com/users/amaidah/orgs","repos_url":"https://api.github.com/users/amaidah/repos","events_url":"https://api.github.com/users/amaidah/events{/privacy}","received_events_url":"https://api.github.com/users/amaidah/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/amaidah/lab-w02d03-js-expense-tracker","description":null,"fork":true,"url":"https://api.github.com/repos/amaidah/lab-w02d03-js-expense-tracker","forks_url":"https://api.github.com/repos/amaidah/lab-w02d03-js-expense-tracker/forks","keys_url":"https://api.github.com/repos/amaidah/lab-w02d03-js-expense-tracker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amaidah/lab-w02d03-js-expense-tracker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amaidah/lab-w02d03-js-expense-tracker/teams","hooks_url":"https://api.github.com/repos/amaidah/lab-w02d03-js-expense-tracker/hooks","issue_events_url":"https://api.github.com/repos/amaidah/lab-w02d03-js-expense-tracker/issues/events{/number}","events_url":"https://api.github.com/repos/amaidah/lab-w02d03-js-expense-tracker/events","assignees_url":"https://api.github.com/repos/amaidah/lab-w02d03-js-expense-tracker/assignees{/user}","branches_url":"https://api.github.com/repos/amaidah/lab-w02d03-js-expense-tracker/branches{/branch}","tags_url":"https://api.github.com/repos/amaidah/lab-w02d03-js-expense-tracker/tags","blobs_url":"https://api.github.com/repos/amaidah/lab-w02d03-js-expense-tracker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amaidah/lab-w02d03-js-expense-tracker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amaidah/lab-w02d03-js-expense-tracker/git/refs{/sha}","trees_url":"https://api.github.com/repos/amaidah/lab-w02d03-js-expense-tracker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amaidah/lab-w02d03-js-expense-tracker/statuses/{sha}","languages_url":"https://api.github.com/repos/amaidah/lab-w02d03-js-expense-tracker/languages","stargazers_url":"https://api.github.com/repos/amaidah/lab-w02d03-js-expense-tracker/stargazers","contributors_url":"https://api.github.com/repos/amaidah/lab-w02d03-js-expense-tracker/contributors","subscribers_url":"https://api.github.com/repos/amaidah/lab-w02d03-js-expense-tracker/subscribers","subscription_url":"https://api.github.com/repos/amaidah/lab-w02d03-js-expense-tracker/subscription","commits_url":"https://api.github.com/repos/amaidah/lab-w02d03-js-expense-tracker/commits{/sha}","git_commits_url":"https://api.github.com/repos/amaidah/lab-w02d03-js-expense-tracker/git/commits{/sha}","comments_url":"https://api.github.com/repos/amaidah/lab-w02d03-js-expense-tracker/comments{/number}","issue_comment_url":"https://api.github.com/repos/amaidah/lab-w02d03-js-expense-tracker/issues/comments{/number}","contents_url":"https://api.github.com/repos/amaidah/lab-w02d03-js-expense-tracker/contents/{+path}","compare_url":"https://api.github.com/repos/amaidah/lab-w02d03-js-expense-tracker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amaidah/lab-w02d03-js-expense-tracker/merges","archive_url":"https://api.github.com/repos/amaidah/lab-w02d03-js-expense-tracker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amaidah/lab-w02d03-js-expense-tracker/downloads","issues_url":"https://api.github.com/repos/amaidah/lab-w02d03-js-expense-tracker/issues{/number}","pulls_url":"https://api.github.com/repos/amaidah/lab-w02d03-js-expense-tracker/pulls{/number}","milestones_url":"https://api.github.com/repos/amaidah/lab-w02d03-js-expense-tracker/milestones{/number}","notifications_url":"https://api.github.com/repos/amaidah/lab-w02d03-js-expense-tracker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amaidah/lab-w02d03-js-expense-tracker/labels{/name}","releases_url":"https://api.github.com/repos/amaidah/lab-w02d03-js-expense-tracker/releases{/id}","deployments_url":"https://api.github.com/repos/amaidah/lab-w02d03-js-expense-tracker/deployments","created_at":"2016-12-07T22:24:29Z","updated_at":"2016-12-08T18:52:15Z","pushed_at":"2016-12-08T18:52:14Z","git_url":"git://github.com/amaidah/lab-w02d03-js-expense-tracker.git","ssh_url":"git@github.com:amaidah/lab-w02d03-js-expense-tracker.git","clone_url":"https://github.com/amaidah/lab-w02d03-js-expense-tracker.git","svn_url":"https://github.com/amaidah/lab-w02d03-js-expense-tracker","homepage":null,"size":128,"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":"WDI-DTLA-41:master","ref":"master","sha":"ba8ed00d003e2ae47332be70940290478c999f04","user":{"login":"WDI-DTLA-41","id":23511292,"avatar_url":"https://avatars.githubusercontent.com/u/23511292?v=3","gravatar_id":"","url":"https://api.github.com/users/WDI-DTLA-41","html_url":"https://github.com/WDI-DTLA-41","followers_url":"https://api.github.com/users/WDI-DTLA-41/followers","following_url":"https://api.github.com/users/WDI-DTLA-41/following{/other_user}","gists_url":"https://api.github.com/users/WDI-DTLA-41/gists{/gist_id}","starred_url":"https://api.github.com/users/WDI-DTLA-41/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WDI-DTLA-41/subscriptions","organizations_url":"https://api.github.com/users/WDI-DTLA-41/orgs","repos_url":"https://api.github.com/users/WDI-DTLA-41/repos","events_url":"https://api.github.com/users/WDI-DTLA-41/events{/privacy}","received_events_url":"https://api.github.com/users/WDI-DTLA-41/received_events","type":"Organization","site_admin":false},"repo":{"id":75775605,"name":"lab-w02d03-js-expense-tracker","full_name":"WDI-DTLA-41/lab-w02d03-js-expense-tracker","owner":{"login":"WDI-DTLA-41","id":23511292,"avatar_url":"https://avatars.githubusercontent.com/u/23511292?v=3","gravatar_id":"","url":"https://api.github.com/users/WDI-DTLA-41","html_url":"https://github.com/WDI-DTLA-41","followers_url":"https://api.github.com/users/WDI-DTLA-41/followers","following_url":"https://api.github.com/users/WDI-DTLA-41/following{/other_user}","gists_url":"https://api.github.com/users/WDI-DTLA-41/gists{/gist_id}","starred_url":"https://api.github.com/users/WDI-DTLA-41/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WDI-DTLA-41/subscriptions","organizations_url":"https://api.github.com/users/WDI-DTLA-41/orgs","repos_url":"https://api.github.com/users/WDI-DTLA-41/repos","events_url":"https://api.github.com/users/WDI-DTLA-41/events{/privacy}","received_events_url":"https://api.github.com/users/WDI-DTLA-41/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WDI-DTLA-41/lab-w02d03-js-expense-tracker","description":null,"fork":false,"url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker","forks_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/forks","keys_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/teams","hooks_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/hooks","issue_events_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/issues/events{/number}","events_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/events","assignees_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/assignees{/user}","branches_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/branches{/branch}","tags_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/tags","blobs_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/git/refs{/sha}","trees_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/statuses/{sha}","languages_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/languages","stargazers_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/stargazers","contributors_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/contributors","subscribers_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/subscribers","subscription_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/subscription","commits_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/commits{/sha}","git_commits_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/git/commits{/sha}","comments_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/comments{/number}","issue_comment_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/issues/comments{/number}","contents_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/contents/{+path}","compare_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/merges","archive_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/downloads","issues_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/issues{/number}","pulls_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/pulls{/number}","milestones_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/milestones{/number}","notifications_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/labels{/name}","releases_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/releases{/id}","deployments_url":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/deployments","created_at":"2016-12-06T22:04:37Z","updated_at":"2016-12-07T21:22:51Z","pushed_at":"2016-12-11T05:48:38Z","git_url":"git://github.com/WDI-DTLA-41/lab-w02d03-js-expense-tracker.git","ssh_url":"git@github.com:WDI-DTLA-41/lab-w02d03-js-expense-tracker.git","clone_url":"https://github.com/WDI-DTLA-41/lab-w02d03-js-expense-tracker.git","svn_url":"https://github.com/WDI-DTLA-41/lab-w02d03-js-expense-tracker","homepage":null,"size":126,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":20,"forks":21,"open_issues":20,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/pulls/16"},"html":{"href":"https://github.com/WDI-DTLA-41/lab-w02d03-js-expense-tracker/pull/16"},"issue":{"href":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/issues/16"},"comments":{"href":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/WDI-DTLA-41/lab-w02d03-js-expense-tracker/statuses/124b3ca8ed6b8f85ef9291ce588aaef4693942f8"}}}}
{"actor":{"display_login":"phlco"}}