MIA Heli - #72
Closed
Helieber wants to merge 2 commits into
Closed
Conversation
sandrabosk
reviewed
Feb 2, 2018
| string = string + hacker1[i].toUpperCase() + " " | ||
| } | ||
| console.log(string) | ||
|
|
Contributor
There was a problem hiding this comment.
// Print all the characters of the navigator's name, in reverse order. ie. "nhoJ"
You're missing this step. Try applying .split, .reverse and .join methods.
| } | ||
| console.log(string) | ||
|
|
||
| var sentence1 = ["The driver's name goes first", "Yo, the navigator goes first definitely", "What?! You both got the same name?"] |
Contributor
There was a problem hiding this comment.
To check if driver's or navigator's name goes first in lexicographic order try applying .localeCompare method.
|
|
||
| // Palindromo | ||
|
|
||
| function checkPalindrome(stringCheck){ |
Contributor
There was a problem hiding this comment.
Very easy way to check if the given word is palindrome is using .split, .reverse, .join methods. Try something like this:
var str = prompt("Let's check the palindrome. Give me a word:");
function checkPalindrome(str) {
return (
str ==
str
.split("")
.reverse()
.join("")
);
}
var value = checkPalindrome(str);
// console.log("value:",value)
if (value === true) {
console.log("The word is palindrome.");
} else {
console.log("The word isn't palindrome.");
}
Contributor
|
Good start Heli. Please check the comments I left here for you. 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.
Made some changes!