8000 GitHub - varunsingh87/order.js: A JavaScript program taking the pizza order of multiple customers
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Nov 6, 2020. It is now read-only.
/ order.js Public archive

A JavaScript program taking the pizza order of multiple customers

License

Apache-2.0, GPL-2.0 licenses found

Licenses found

Apache-2.0
LICENSE
GPL-2.0
LICENSE.md
Notifications You must be signed in to change notification settings

varunsingh87/order.js

Order.js is the first ES6 program (through the console) I have made that is hosted on GitHub through Git workflow. The person takes an order through a function call and the price is calculated based on what they ordered and how many items.

This is a program in which you take an order with nested functions with the arguments including topping, crust type, quantity, how-well-roasted, name-of-drink, and size. The price is calculated. Based on the number of orders in a group of customers, the total group order price is calculated.

A function declaration calculates sub total, adds 6% tax, and prints the total in US Dollars. The total is calculated by adding the total side cost - a constant integer price per side - and the total meal cost - a constant integer price per meal. When you call the group order function, you pass every customers' order as a value of the array, the one and only argument of the group order function call. You can take different types of food orders by calling different functions for the take order.

In the new version of the app, the destructuring technique is used. In each of the functions for the orders listed below, the argument is an object. In the function, the object properties are referred to as if they are regular parameters. This is achieved by wrapping the properties in curly braces in the parameter list, called destructuring.

The following are the current options to order food and drinks:

  • pizza
  • hot dog
  • fries
  • drink
  • burger
<script> let sslink = document.createElement("link"); sslink.href = "css/normalize.css"; sslink.rel = "stylesheet"; sslink.type = "text/css"; document.head.appendChild(sslink); let favLink = document.createElement("link"); favLink.rel = "shortcut icon"; favLink.type = "images/x-icon"; favLink.href = "images/icon.ico"; document.head.appendChild(favLink); </script>

About

A JavaScript program taking the pizza order of multiple customers

Topics

Resources

License

Apache-2.0, GPL-2.0 licenses found

Licenses found

Apache-2.0
LICENSE
GPL-2.0
LICENSE.md

Code of conduct

Stars

Watchers

Forks

Packages 372B

No packages published
0