-
Notifications
You must be signed in to change notification settings - Fork 0
Basic program without comments #4
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
base: gh-pages
Are you sure you want to change the base?
Conversation
reneemeyer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good start, see comments below
02week/pigLatin.js
Outdated
| if(vowelPosition == 0){ | ||
| return word + "yay" | ||
| } | ||
| let mainString = word.split(""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be const
02week/pigLatin.js
Outdated
| let mainString = word.split(""); | ||
| const firstConsonants = mainString.splice(0,vowelPosition).join(""); | ||
| //not sure if there is a single line way to do this, settled on this. Still thinking about it | ||
| mainString = mainString.join("") + firstConsonants + "ay" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're mutating this variable a lot here and it's unnecessary, join the array and return this. return mainString.join("") + firstConsonants + "ay"
02week/pigLatin.js
Outdated
| } | ||
| if (!letterIsValid){ | ||
| //if letter is still invalid the entire string is invalid | ||
| return 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just return the evaluation, there's no need to return 0 or 1
Checkpoint Rubric
This is the rubric that your instructor will use to grade your checkpoints. Please do not edit.
Checkpoint 1
Checkpoint 2
Checkpoint 3