A simple restaurant ordering app that utilises a variety of JavaScript array methods and using the event listener
Things I have learnt:
- One of the major concept I learnt was the use of using dataset attributes to specifically select different areas that has the corresponding data attribute, rather than creating multiple selectors for buttons. -This app was a great opportunity to practice the use of .map() and .forEach() as well as .reduce()
Challenges I faced:
- I had a very difficult time in getting the total amounts to add up together and display the total at the bottom of the screen. With the help of a friend, I was able to achieve this creating a global variable with an empty array, push the item that was clicked into the array to store the data. From there, I was able to calculate the total successfully.
Features needing to be implemented:
-
Form validation, require users to input the proper length of characters for their name. Displaying a sign, signalling the user that the input is invalid.
-
Adding a method to allow users to choose the quantity of the items, then totalling them up, rather than showing multiples of the same items in the order screen.