Open
Conversation
HIPPIEKICK
approved these changes
Sep 13, 2024
Contributor
HIPPIEKICK
left a comment
There was a problem hiding this comment.
Great job on completing this JavaScript pizzeria! 🍕
JavaScript
- You're using if and else if statements effectively to handle the different food choices 👍
- Currently, your code assumes that the user will enter valid inputs (e.g., choosing either 1, 2, or 3 for food choices). It would be a good idea to add some input validation to handle unexpected inputs (e.g., if someone enters 4 or a letter).
- Your logic for determining if the person is a child or adult works, but it could be simplified by removing the parseInt(age) call from the if condition and instead check this earlier (in the prompt)
- You've named your variables in a clear and descriptive way overall ⭐
Clean Code
- Your indentation is mostly consistent, but there are a few places where nested code could be indented further for better readability, such as in the deeply nested if-else blocks.
- Please be consistent with whether or not you're using semi colons! If you're using they, you need to learn all the places to put them
Overall, really good job with this project - it's a functioning pizzeria bot 🥳
| `Welcome to our Javascript Pizzeria. Ready to Start? - Click 'OK' to begin.` | ||
| ) | ||
|
|
||
| let person = prompt("Please enter your name:", "Harry Potter"); |
Contributor
There was a problem hiding this comment.
Ha! Didn't know you could do this 🤓
|
|
||
| let subChoice | ||
| // Step 1 - Welcome and introduction | ||
| // Your code goes here |
Contributor
There was a problem hiding this comment.
Remove any code and comments that is not useful
|
|
||
| // Step 3 - Subtype choice | ||
| // Your code goes here | ||
| if (foodChoice === "1") { foodChoice = "Pizza" |
Contributor
There was a problem hiding this comment.
Indentation
if (foodChoice === "1") {
foodChoice = "Pizza"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://liselottespizza2.netlify.app/