by Geof Rosenmund
A demonstration of objects using constructors and properties.
- HTML
- JavaScript
- JQuery
- CSS
- Bootstrap
This is a simple webpage that takes a size and toppings array and creates a Pizza object. It then uses a prototype function to evaluate the contents of the object and spit out a price. It then displays the size, toppings, and price of the pizza ordered.
Describe: Pizza();
Test: A constructor for creating a pizza object
Expect: Pizza().toEqual Pizza{size, [toppings]}
Describe: Pizza.prototype.pizzaPrice();
Test: Determine price of pizza by checking size and toppings.length
Expect pizzaPrice(small, [Pepperoni, Olives]).toEqual "13"
Describe: Order();
Test: Add multiple pizzas to one object
Expect Order().toEqual Order{pizza1, pizza2}
Describe: pizzaPizza();
Test: Pull information additional times from the form creating more pizzas that can be priced and displayed
Expect pizzaPizza().toEqual newOrder.pizzas {{1:pizza, 2:pizza} Toppings: 2 arrays, currentId: 2}
- Clone the repository to your desktop from GitHub
- Navigate to the top level of the directory
- Open the index.html file in a browser
Repository: https://github.com/CrankyJones/PizzaTime
There are no known bugs at this time.
MIT Copyright (c) [2021] [Geof Rosenmund]
Geof Rosenmund (geof.rosenmunds.email@gmail.com)