{"action":"created","comment":{"url":"https://api.github.com/repos/chieakiba/meal-calculator/pulls/comments/68882565","id":68882565,"diff_hunk":"@@ -0,0 +1,98 @@\n+'use strict';\n+//Meal price\n+var MealPrice = {\n+    'spaghetti': 10,\n+    'lasagna': 9,\n+    'eggplant parmigiano': 13,\n+    'quattro formaggi pizza': 11\n+};\n+\n+//Drink price\n+var DrinkPrice = {\n+    'cabernet sauvignon': 4,\n+    'grappa': 4.5,\n+    'chianti': 5.5,\n+    'riesling': 5\n+};\n+\n+\n+var Diner = function (orders) {\n+    this.orders = orders;\n+};\n+\n+var sally = new Diner({\n+    food: ['spaghetti'],\n+    drink: ['cabernet sauvignon']\n+});\n+//var sally_total_meal = 0;\n+//for (var i = 0; i < sally.orders.food.length; i++) {\n+//    var food = MealPrice[sally.orders.food[i]];\n+//    if (food !== undefined) {\n+//        sally_total_meal += food;\n+//    }\n+//\n+//}\n+//var meal = MealPrice[sally.orders.food[i]];\n+//var drink = DrinkPrice[sally.orders.drink];\n+//var total = meal + drink;\n+\n+console.log(sally.orders);\n+\n+var richard = new Diner({\n+    food: ['lasagna'],\n+    drink: ['grappa']\n+});\n+console.log(richard.orders);\n+\n+var david = new Diner({\n+    food: ['eggplant parmigiano'],\n+    drink: ['chianti']\n+});\n+console.log(david.orders);\n+\n+var jessica = new Diner({\n+    food: ['quattro formaggi pizza'],\n+    drink: ['riesling']\n+});\n+console.log(jessica.orders);\n+//Diner objects\n+var diners = [sally, richard, david, jessica];\n+console.log(total(diners));\n+\n+function total(diners) {\n+    var totalBill = 0;\n+    for (var i = 0; i < diners.length; i++) {\n+        var diner = diners[i];\n+        var totalFood = 0;\n+        for (var j = 0; j < diner.orders.food.length; j++) {\n+            var food = MealPrice[diner.orders.food[j]];\n+            if (food !== undefined) {","path":"js/meal_calculator.js","position":69,"original_position":69,"commit_id":"d53a27aa60d8a5d3d983da3b10302350d81b4f63","original_commit_id":"b94066a18d921ad3973d9608b36b2a252213943d","user":{"login":"chieakiba","id":17013004,"avatar_url":"https://avatars.githubusercontent.com/u/17013004?v=3","gravatar_id":"","url":"https://api.github.com/users/chieakiba","html_url":"https://github.com/chieakiba","followers_url":"https://api.github.com/users/chieakiba/followers","following_url":"https://api.github.com/users/chieakiba/following{/other_user}","gists_url":"https://api.github.com/users/chieakiba/gists{/gist_id}","starred_url":"https://api.github.com/users/chieakiba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chieakiba/subscriptions","organizations_url":"https://api.github.com/users/chieakiba/orgs","repos_url":"https://api.github.com/users/chieakiba/repos","events_url":"https://api.github.com/users/chieakiba/events{/privacy}","received_events_url":"https://api.github.com/users/chieakiba/received_events","type":"User","site_admin":false},"body":"Thanks! Fixed that.","created_at":"2016-06-29T04:09:02Z","updated_at":"2016-06-29T04:09:02Z","html_url":"https://github.com/chieakiba/meal-calculator/pull/1#discussion_r68882565","pull_request_url":"https://api.github.com/repos/chieakiba/meal-calculator/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/chieakiba/meal-calculator/pulls/comments/68882565"},"html":{"href":"https://github.com/chieakiba/meal-calculator/pull/1#discussion_r68882565"},"pull_request":{"href":"https://api.github.com/repos/chieakiba/meal-calculator/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/chieakiba/meal-calculator/pulls/1","id":75575851,"html_url":"https://github.com/chieakiba/meal-calculator/pull/1","diff_url":"https://github.com/chieakiba/meal-calculator/pull/1.diff","patch_url":"https://github.com/chieakiba/meal-calculator/pull/1.patch","issue_url":"https://api.github.com/repos/chieakiba/meal-calculator/issues/1","number":1,"state":"open","locked":false,"title":"Just added function to calculate the total bill","user":{"login":"chieakiba","id":17013004,"avatar_url":"https://avatars.githubusercontent.com/u/17013004?v=3","gravatar_id":"","url":"https://api.github.com/users/chieakiba","html_url":"https://github.com/chieakiba","followers_url":"https://api.github.com/users/chieakiba/followers","following_url":"https://api.github.com/users/chieakiba/following{/other_user}","gists_url":"https://api.github.com/users/chieakiba/gists{/gist_id}","starred_url":"https://api.github.com/users/chieakiba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chieakiba/subscriptions","organizations_url":"https://api.github.com/users/chieakiba/orgs","repos_url":"https://api.github.com/users/chieakiba/repos","events_url":"https://api.github.com/users/chieakiba/events{/privacy}","received_events_url":"https://api.github.com/users/chieakiba/received_events","type":"User","site_admin":false},"body":"Still need to finish things up (like adding tax and tips and then dividing the total among each diner among other things) but any advice or suggestion on the current JavaScript code would be super helpful :)","created_at":"2016-06-29T01:26:57Z","updated_at":"2016-06-29T04:09:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6e0289a220c147df8fe135211147d49172114832","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/chieakiba/meal-calculator/pulls/1/commits","review_comments_url":"https://api.github.com/repos/chieakiba/meal-calculator/pulls/1/comments","review_comment_url":"https://api.github.com/repos/chieakiba/meal-calculator/pulls/comments{/number}","comments_url":"https://api.github.com/repos/chieakiba/meal-calculator/issues/1/comments","statuses_url":"https://api.github.com/repos/chieakiba/meal-calculator/statuses/d53a27aa60d8a5d3d983da3b10302350d81b4f63","head":{"label":"chieakiba:staging","ref":"staging","sha":"d53a27aa60d8a5d3d983da3b10302350d81b4f63","user":{"login":"chieakiba","id":17013004,"avatar_url":"https://avatars.githubusercontent.com/u/17013004?v=3","gravatar_id":"","url":"https://api.github.com/users/chieakiba","html_url":"https://github.com/chieakiba","followers_url":"https://api.github.com/users/chieakiba/followers","following_url":"https://api.github.com/users/chieakiba/following{/other_user}","gists_url":"https://api.github.com/users/chieakiba/gists{/gist_id}","starred_url":"https://api.github.com/users/chieakiba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chieakiba/subscriptions","organizations_url":"https://api.github.com/users/chieakiba/orgs","repos_url":"https://api.github.com/users/chieakiba/repos","events_url":"https://api.github.com/users/chieakiba/events{/privacy}","received_events_url":"https://api.github.com/users/chieakiba/received_events","type":"User","site_admin":false},"repo":{"id":62165638,"name":"meal-calculator","full_name":"chieakiba/meal-calculator","owner":{"login":"chieakiba","id":17013004,"avatar_url":"https://avatars.githubusercontent.com/u/17013004?v=3","gravatar_id":"","url":"https://api.github.com/users/chieakiba","html_url":"https://github.com/chieakiba","followers_url":"https://api.github.com/users/chieakiba/followers","following_url":"https://api.github.com/users/chieakiba/following{/other_user}","gists_url":"https://api.github.com/users/chieakiba/gists{/gist_id}","starred_url":"https://api.github.com/users/chieakiba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chieakiba/subscriptions","organizations_url":"https://api.github.com/users/chieakiba/orgs","repos_url":"https://api.github.com/users/chieakiba/repos","events_url":"https://api.github.com/users/chieakiba/events{/privacy}","received_events_url":"https://api.github.com/users/chieakiba/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chieakiba/meal-calculator","description":null,"fork":false,"url":"https://api.github.com/repos/chieakiba/meal-calculator","forks_url":"https://api.github.com/repos/chieakiba/meal-calculator/forks","keys_url":"https://api.github.com/repos/chieakiba/meal-calculator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chieakiba/meal-calculator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chieakiba/meal-calculator/teams","hooks_url":"https://api.github.com/repos/chieakiba/meal-calculator/hooks","issue_events_url":"https://api.github.com/repos/chieakiba/meal-calculator/issues/events{/number}","events_url":"https://api.github.com/repos/chieakiba/meal-calculator/events","assignees_url":"https://api.github.com/repos/chieakiba/meal-calculator/assignees{/user}","branches_url":"https://api.github.com/repos/chieakiba/meal-calculator/branches{/branch}","tags_url":"https://api.github.com/repos/chieakiba/meal-calculator/tags","blobs_url":"https://api.github.com/repos/chieakiba/meal-calculator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chieakiba/meal-calculator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chieakiba/meal-calculator/git/refs{/sha}","trees_url":"https://api.github.com/repos/chieakiba/meal-calculator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chieakiba/meal-calculator/statuses/{sha}","languages_url":"https://api.github.com/repos/chieakiba/meal-calculator/languages","stargazers_url":"https://api.github.com/repos/chieakiba/meal-calculator/stargazers","contributors_url":"https://api.github.com/repos/chieakiba/meal-calculator/contributors","subscribers_url":"https://api.github.com/repos/chieakiba/meal-calculator/subscribers","subscription_url":"https://api.github.com/repos/chieakiba/meal-calculator/subscription","commits_url":"https://api.github.com/repos/chieakiba/meal-calculator/commits{/sha}","git_commits_url":"https://api.github.com/repos/chieakiba/meal-calculator/git/commits{/sha}","comments_url":"https://api.github.com/repos/chieakiba/meal-calculator/comments{/number}","issue_comment_url":"https://api.github.com/repos/chieakiba/meal-calculator/issues/comments{/number}","contents_url":"https://api.github.com/repos/chieakiba/meal-calculator/contents/{+path}","compare_url":"https://api.github.com/repos/chieakiba/meal-calculator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chieakiba/meal-calculator/merges","archive_url":"https://api.github.com/repos/chieakiba/meal-calculator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chieakiba/meal-calculator/downloads","issues_url":"https://api.github.com/repos/chieakiba/meal-calculator/issues{/number}","pulls_url":"https://api.github.com/repos/chieakiba/meal-calculator/pulls{/number}","milestones_url":"https://api.github.com/repos/chieakiba/meal-calculator/milestones{/number}","notifications_url":"https://api.github.com/repos/chieakiba/meal-calculator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chieakiba/meal-calculator/labels{/name}","releases_url":"https://api.github.com/repos/chieakiba/meal-calculator/releases{/id}","deployments_url":"https://api.github.com/repos/chieakiba/meal-calculator/deployments","created_at":"2016-06-28T18:42:50Z","updated_at":"2016-06-28T18:44:42Z","pushed_at":"2016-06-29T02:56:32Z","git_url":"git://github.com/chieakiba/meal-calculator.git","ssh_url":"git@github.com:chieakiba/meal-calculator.git","clone_url":"https://github.com/chieakiba/meal-calculator.git","svn_url":"https://github.com/chieakiba/meal-calculator","homepage":null,"size":6,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"chieakiba:master","ref":"master","sha":"dc835355a4eef89d7803308744fc0d8716f9b11a","user":{"login":"chieakiba","id":17013004,"avatar_url":"https://avatars.githubusercontent.com/u/17013004?v=3","gravatar_id":"","url":"https://api.github.com/users/chieakiba","html_url":"https://github.com/chieakiba","followers_url":"https://api.github.com/users/chieakiba/followers","following_url":"https://api.github.com/users/chieakiba/following{/other_user}","gists_url":"https://api.github.com/users/chieakiba/gists{/gist_id}","starred_url":"https://api.github.com/users/chieakiba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chieakiba/subscriptions","organizations_url":"https://api.github.com/users/chieakiba/orgs","repos_url":"https://api.github.com/users/chieakiba/repos","events_url":"https://api.github.com/users/chieakiba/events{/privacy}","received_events_url":"https://api.github.com/users/chieakiba/received_events","type":"User","site_admin":false},"repo":{"id":62165638,"name":"meal-calculator","full_name":"chieakiba/meal-calculator","owner":{"login":"chieakiba","id":17013004,"avatar_url":"https://avatars.githubusercontent.com/u/17013004?v=3","gravatar_id":"","url":"https://api.github.com/users/chieakiba","html_url":"https://github.com/chieakiba","followers_url":"https://api.github.com/users/chieakiba/followers","following_url":"https://api.github.com/users/chieakiba/following{/other_user}","gists_url":"https://api.github.com/users/chieakiba/gists{/gist_id}","starred_url":"https://api.github.com/users/chieakiba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chieakiba/subscriptions","organizations_url":"https://api.github.com/users/chieakiba/orgs","repos_url":"https://api.github.com/users/chieakiba/repos","events_url":"https://api.github.com/users/chieakiba/events{/privacy}","received_events_url":"https://api.github.com/users/chieakiba/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chieakiba/meal-calculator","description":null,"fork":false,"url":"https://api.github.com/repos/chieakiba/meal-calculator","forks_url":"https://api.github.com/repos/chieakiba/meal-calculator/forks","keys_url":"https://api.github.com/repos/chieakiba/meal-calculator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chieakiba/meal-calculator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chieakiba/meal-calculator/teams","hooks_url":"https://api.github.com/repos/chieakiba/meal-calculator/hooks","issue_events_url":"https://api.github.com/repos/chieakiba/meal-calculator/issues/events{/number}","events_url":"https://api.github.com/repos/chieakiba/meal-calculator/events","assignees_url":"https://api.github.com/repos/chieakiba/meal-calculator/assignees{/user}","branches_url":"https://api.github.com/repos/chieakiba/meal-calculator/branches{/branch}","tags_url":"https://api.github.com/repos/chieakiba/meal-calculator/tags","blobs_url":"https://api.github.com/repos/chieakiba/meal-calculator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chieakiba/meal-calculator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chieakiba/meal-calculator/git/refs{/sha}","trees_url":"https://api.github.com/repos/chieakiba/meal-calculator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chieakiba/meal-calculator/statuses/{sha}","languages_url":"https://api.github.com/repos/chieakiba/meal-calculator/languages","stargazers_url":"https://api.github.com/repos/chieakiba/meal-calculator/stargazers","contributors_url":"https://api.github.com/repos/chieakiba/meal-calculator/contributors","subscribers_url":"https://api.github.com/repos/chieakiba/meal-calculator/subscribers","subscription_url":"https://api.github.com/repos/chieakiba/meal-calculator/subscription","commits_url":"https://api.github.com/repos/chieakiba/meal-calculator/commits{/sha}","git_commits_url":"https://api.github.com/repos/chieakiba/meal-calculator/git/commits{/sha}","comments_url":"https://api.github.com/repos/chieakiba/meal-calculator/comments{/number}","issue_comment_url":"https://api.github.com/repos/chieakiba/meal-calculator/issues/comments{/number}","contents_url":"https://api.github.com/repos/chieakiba/meal-calculator/contents/{+path}","compare_url":"https://api.github.com/repos/chieakiba/meal-calculator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chieakiba/meal-calculator/merges","archive_url":"https://api.github.com/repos/chieakiba/meal-calculator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chieakiba/meal-calculator/downloads","issues_url":"https://api.github.com/repos/chieakiba/meal-calculator/issues{/number}","pulls_url":"https://api.github.com/repos/chieakiba/meal-calculator/pulls{/number}","milestones_url":"https://api.github.com/repos/chieakiba/meal-calculator/milestones{/number}","notifications_url":"https://api.github.com/repos/chieakiba/meal-calculator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chieakiba/meal-calculator/labels{/name}","releases_url":"https://api.github.com/repos/chieakiba/meal-calculator/releases{/id}","deployments_url":"https://api.github.com/repos/chieakiba/meal-calculator/deployments","created_at":"2016-06-28T18:42:50Z","updated_at":"2016-06-28T18:44:42Z","pushed_at":"2016-06-29T02:56:32Z","git_url":"git://github.com/chieakiba/meal-calculator.git","ssh_url":"git@github.com:chieakiba/meal-calculator.git","clone_url":"https://github.com/chieakiba/meal-calculator.git","svn_url":"https://github.com/chieakiba/meal-calculator","homepage":null,"size":6,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/chieakiba/meal-calculator/pulls/1"},"html":{"href":"https://github.com/chieakiba/meal-calculator/pull/1"},"issue":{"href":"https://api.github.com/repos/chieakiba/meal-calculator/issues/1"},"comments":{"href":"https://api.github.com/repos/chieakiba/meal-calculator/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/chieakiba/meal-calculator/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/chieakiba/meal-calculator/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/chieakiba/meal-calculator/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/chieakiba/meal-calculator/statuses/d53a27aa60d8a5d3d983da3b10302350d81b4f63"}}}}
{"actor":{"display_login":"chieakiba"}}