Open
Conversation
HIPPIEKICK
previously requested changes
Sep 13, 2024
Contributor
There was a problem hiding this comment.
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 |
Contributor
There was a problem hiding this comment.
Pepperoni is not defined - should be quotation marks around it
Author
There was a problem hiding this comment.
Hi, @JennieDalgren made the requested changes to the JS file.
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.
Netlify link
https://66de0156d116e596d11ff09e--coruscating-basbousa-190b83.netlify.app/