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

Jonas chatbot #286

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

Jonas chatbot #286

wants to merge 3 commits into from

Conversation

Jonash189
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 job building this chatbot café! ☕

JavaScript

  • I see you’ve added DOMContentLoaded to ensure that all DOM elements are available before interacting with them. Nice idea!
  • Functions like showMessage, handleNameInput, handleDrinkChoice, and others are well-defined and break down the logic into smaller, manageable parts.
  • Solid conditions and flow, but it would be nice to see some other input options for users (e.g. buttons), but great that you're validating the input and continue to prompt the user
  • There is some repeated logic across the input handling functions (handleDrinkChoice, handleFoodChoice, handleDishChoice). Consider creating a more generic input validation function to simplify the code.
  • Great idea clearing the input! You could create a helper function (e.g., clearInput()) to streamline this action.

Clean Code

  • Be consistent with if you're using single or double quotes

Overall, good job! However I would love to see you go a bit more wild with input options another time 😉

const input = nameInput.value; // Get input from user
nameInput.value = ""; // Clear input field

if (!isAskingForDrink && !isAskingForFood && !isChoosingDish) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Hehe, couldn't this be isAskingForName 👀

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.

2 participants