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

JavaScript pizzeria :) #155

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

JavaScript pizzeria :) #155

wants to merge 3 commits into from

Conversation

cholpoun
Copy link

@cholpoun cholpoun commented Sep 8, 2024

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.

Good job on getting this project together! You've done a great job with your code, covering all the necessary steps for interaction, conditional statements, and user input.

JavaScript

  • You’ve used if-else statements correctly to handle various user inputs. However, there’s a slight issue with comparing guestAge. In JavaScript, you should be comparing numbers, not strings. I think you meant to do this with the line const age = Number(guestAge); but then you're doing the comparison based on guestAge anyway. On this same topic, I think clearer variable names could make this clearer - e.g. instead of guestAge and age, they could be named userInputAge and ageConvertedToNumber or something "overly descriptive". Feel free to name variables as descriptive as you want.
  • Consider adding even more validation, such as toLowerCase()
  • Use template literals instead of plus sign to improve clean code and readability:
alert(`Hi ${guestName}!`)

Changes requested

  • Add quotation marks to pepperoni
  • Correct age validation

With this said, you managed really well with the project - just need these tiny corrections 😄

code/script.js Outdated
selectedFoodType = 'Margherita'
} else if (pizzaType === '2') {
alert('You have chosen Pepperoni!')
selectedFoodType = Pepperoni
Copy link
Contributor

Choose a reason for hiding this comment

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

Pepperoni is not defined - should be quotation marks around it

Copy link
Author

Choose a reason for hiding this comment

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

Hi, @JennieDalgren made the requested changes to the JS file.

Copy link
Contributor

@JennieDalgren JennieDalgren left a comment

Choose a reason for hiding this comment

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

👍

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