This repository was archived by the owner on Jan 3, 2023. It is now read-only.
Part 1&2 in Bike For Refugee Solution#1
Open
MohamadAlissa wants to merge 5 commits intoCodeYourFuture:masterfrom
Open
Part 1&2 in Bike For Refugee Solution#1MohamadAlissa wants to merge 5 commits intoCodeYourFuture:masterfrom
MohamadAlissa wants to merge 5 commits intoCodeYourFuture:masterfrom
Conversation
IsmaelMartinez
left a comment
There was a problem hiding this comment.
good job.
In this case, as the validation is small (even when adding the extras) doesn't really matter much if you run it twice.
If the validation functions get big, that could slow the process down.
js/homework.js
Outdated
| //submit function | ||
| function submitForm(event) { | ||
| event.preventDefault(); | ||
| checkEmail(); |
There was a problem hiding this comment.
This lines (51,52 and 53) are repeated so will run twice. The if statement will run them.
If the reason for doing so is to always validate the 3 elements, then do the opposite (check invalid) and use OR statements.
Author
There was a problem hiding this comment.
Thank you for your feedback.
I solve the problem by assign the validate functions results to three variables.Then check the variables to avoid run the functions twice
thank you again.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
No description provided.