Open
Conversation
HIPPIEKICK
approved these changes
Sep 12, 2024
Contributor
HIPPIEKICK
left a comment
There was a problem hiding this comment.
Nice job with the project! 🍕
JavaScript
- Your use of if-else statements to handle the different choices has a good flow 👍
- When checking the age, you're assuming the user enters a number, but in JavaScript, prompt always returns a string. To avoid any issues, you could use parseInt() to ensure age is treated as a number:
let age = parseInt(prompt("Is this food for a child or an adult? Please type your age:"));
Clean Code
- Descriptive and clear variable names, nice job! One minor suggestion would be to use more descriptive names for simple variables like name—maybe userName could be more self-explanatory.
- Overall your code is well-indented! Just one thing I'd like to point out regarding else if, it should be on the same line as the end of the if:
if (something) {
//
} else if (something) {
//
}
Overall really good job Heléne, and I look forward to seeing what you will create next 🥳
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://gilded-marzipan-59036d.netlify.app/