The goal for this project is to create a Pizza Bot using JavaScript ๐๐ฉโ๐ป. We will be able to gather data from the user, such as type and amount of pizzas. With this information, we should create a JavaScript program to do some basic calculations and return an order summary/confirmation text to the user.
- We decided to start by building an HTML form in which users can input the name of the pizza and how many they want to order - connect those HTML elements to JavaScript - and then store that data in variables that can be used for our functions.
- The whole program is triggered by submiting the order form: It will start by checking whether the Pizza name input by the customer is correct, ask for a correct pizza type if needed, or move on to the next steps. This is managed with an if/ else function.
- We learned about the preventDefault() event method, which came in handy for this project in order to prevent the page from refreshing every time the form is submitted, and the rest of the program could run ๐
- This was also a good practice on closely following the control flow, so we could decide where it is best to position variables and call functions, depending on how the computer (and the user) is reading our code ๐ฅ
- This is the first project in which we deep dive into JavaScript: we learned that there are several ways to solve a single problem - we might come up with a specific solution, which seems long and complex, later to find that there is a simpler and shorter way to do it. We look forward to learning more and be able to implement these more efficient methods ๐ช
- โ This was also our first pair programming project, and it was an experience we learned a lot from. It was really helpful being able to brainstorm together, combine ideas and come to solutions faster as a result.
๐ Find Lili & Vane's Pizza Delivery live at Netilfy here: https://optimistic-northcutt-67f18c.netlify.app/ (Work in progress ๐จ: hopefully we can make it deliver a real pizza to you some time in the future)