MIA full time web dev - #190
Closed
yonathanh wants to merge 2 commits into
Closed
Conversation
sandrabosk
approved these changes
Aug 14, 2018
| // Lorem ipsum generator | ||
| console.log("Driver's name"); | ||
| for (let i = 0; i < hacker1.length; i++) { | ||
| console.log(hacker1[i].toUpperCase()); |
Contributor
There was a problem hiding this comment.
You should make an empty space between each letter.
|
|
||
| console.log("Nav's name"); | ||
| for (let i = hacker2.length - 1; i >= 0; i--) { | ||
| console.log(hacker2[i]); |
Contributor
There was a problem hiding this comment.
This is printing all the letters in the backward order, but also you need to put it back to the string.
| console.log(hacker2[i]); | ||
| } | ||
|
|
||
| if (hacker1 < hacker2) { |
Contributor
There was a problem hiding this comment.
To sort the strings alphabetically, try using .localeCompare() or some other sorting method.
| let palindrom = prompt("input a word to test for palindrom", "harry potter"); | ||
|
|
||
| function checkPalindrom(palindrom) { | ||
| for (let i = 0, j = palindrom.length; i < palindrom.length; i++, j--) { |
Contributor
There was a problem hiding this comment.
The test is failing but if you make a small update where you assign value to the j it will work:
for (let i = 0, j = palindrom.length-1; i < palindrom.length; i++, j--) {
// code goes here
}
Contributor
|
Good work. Keep it like this. Thank you for submitting. |
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.
No description provided.