Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Estefanny's PR pizzabot #148

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Estefanny's PR pizzabot #148

wants to merge 8 commits into from

Conversation

FannyEste
Copy link

Copy link
Contributor

@HIPPIEKICK HIPPIEKICK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work on tackling this project! 🎉

JavaScript

  • Nice usage of the while loop and good control flow 👍
  • You defined a helpful error message errMsg for incorrect input, which is great for user experience
  • While using + to concatenate strings works, it's generally cleaner to use template literals (backticks) in modern JavaScript. It will make your code easier to read:
alert(`Hi ${customerName}! What are you craving today?`)
  • Currently, the while loop relies on an empty string check to keep prompting the user. It might be cleaner and safer to check if the input is one of the valid options directly.

Overall, really good job with this project - these are just some things to consider going forward ⭐

while (isNaN(age) == true || age < 1 || 100 < age) {
age = prompt("How old are you?", "Please type your age here")
if (isNaN(age) == true || age < 1 || 100 < age) {
alert("Please enter a valid age.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha what if I'm really old 👀

Copy link

@EmelieNyberg EmelieNyberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried your webpage and it worked really good! I even tried to fail som of the questions, but that was inpossible since you had made really cool loops for that😍
Great job with the project!

let foodType = ""
while (foodType == "") {
if (foodChoice == "Pizza") {
choice = prompt("Please enter a number: \n 1 - Napolitana \n 2 - Margherita \n 3 - Sicilian", "Please type you number of choice here")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be cool if you also included something in the message like, "What type of pizza would you like?" Please enter a number.....🤩

Comment on lines +15 to +26
while (foodChoice == "") {
let choice = prompt("Please enter a number: \n 1 - Pizza \n 2 - Pasta \n 3 - Salad", "Please type you number of choice here")
if (choice == 1) {
foodChoice = "Pizza"
} else if (choice == 2) {
foodChoice = "Pasta"
} else if (choice == 3) {
foodChoice = "Salad"
} else {
alert(errMsg)
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The loop was really cool! Nice that you get back to the same question again if you type the wrong answer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants