You will:
- Use the provided Starter Code Repository: https://github.com/CodeSpace-Academy/Module_6_StudentNo_Classcode_Group_Name-Surname_JSL06
- Code your solution.
- Commit changes to your GitHub repository.
- Submit the GitHub Repository Link to the LMS [JSL06] Submission Project Tab.
In this coding challenge, you will build a simple menu display system for a fictional UberEats restaurant called "CodeCuisine." The goal is to display different categories of food items and allow users to add items to their order with a click. This challenge will help you apply various JavaScript concepts, including functions, closures, and event handling, to create an interactive menu.
- Create and use functions to dynamically populate the menu items on the page.
- Implement a callback function to handle adding items to the order.
- Use closures to maintain the state of the order.
- Utilize function expressions and anonymous functions.
- Call built-in functions and create custom functions to manage the menu and order system.
-
Use the Project Files: Begin by accessing the starter code in the JSL06 GitHub repo.
-
JavaScript Implementation: Use the provided starter code in
index.js
as a foundation for your application. The starter code contains placeholders for key functions and comments to guide you through the implementation.-
menu
: Themenu
object contains sample menu data, including categories and items. You can expand this menu with more items if needed. -
displayMenuItems(menu)
: This function should dynamically create and display menu items grouped by category. Iterate over themenu
object and create HTML elements for each category and item. Attach event listeners to the menu items to handle adding items to the order. -
addToOrder(itemName)
: Implement this callback function to update the order summary when an item is added. You can use closures to maintain the state of the order. Calculate and update the total price accordingly. -
initMenuSystem(menu)
: Call thedisplayMenuItems
function with the menu data and attach event listeners to menu items.
-
-
Testing: Thoroughly test your application to ensure that it can correctly add items to the order and that the order total updates as expected.
To complete this challenge, follow these steps:
- Clone the provided Starter Code Repository to your local development environment: Starter Code Repository.
- Open the cloned project in your code editor.
- Code your solution following the provided instructions and comments in the starter code.
- Commit your changes to your local Git repository with meaningful commit messages.
- Push your local Git repository to your GitHub account.
- Verify that the changes have been successfully pushed to your GitHub repository.
- Ensure that your code includes the necessary modifications to meet the challenge requirements.
- Your GitHub repository should contain the updated code files.
- We will review your GitHub repository to ensure that it contains the updated code files.
- We will assess the modifications made to the code to verify that they effectively meet the challenge requirements.
- We will consider the commit history and meaningful commit messages to evaluate your coding process.
By following these steps and completing the challenge, you will demonstrate your ability to create interactive web applications using JavaScript. Good luck, and enjoy building the CodeCuisine Menu Display System!