-
Notifications
You must be signed in to change notification settings - Fork 0
Class4piglatin #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
stu-k
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.
#solidwork on your input scrubbing and string methods. Your else statement assumes that if the first letter isn't a vowel, the second one is. This isn't always true! This test on line 46 is failing because of this.
| // Your code here | ||
|
|
||
| // make (word) all lowercase | ||
| const lowerThatCase = word.toLowerCase().trim(); |
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.
Nice daisy chain.
| // make that into array | ||
| const splitWord = lowerThatCase.split(''); | ||
| // check if any vowels if not move on to normalcy | ||
| if (splitWord[0] === 'a' || splitWord[0] === 'e' || splitWord[0] === 'i' || splitWord[0] === 'o' || splitWord[0] === 'u'){ |
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.
Using what you now know about .indexOf(), this could be simplified.
| // check if any vowels if not move on to normalcy | ||
| if (splitWord[0] === 'a' || splitWord[0] === 'e' || splitWord[0] === 'i' || splitWord[0] === 'o' || splitWord[0] === 'u'){ | ||
| return lowerThatCase + 'yay'; | ||
| } else { |
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.
This else statement runs after the first letter is determined to not be a vowell, but then assumes the next letter is.
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