Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@Helieber
Copy link

@Helieber Helieber commented Feb 1, 2018

Made some changes!

string = string + hacker1[i].toUpperCase() + " "
}
console.log(string)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// 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?"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To check if driver's or navigator's name goes first in lexicographic order try applying .localeCompare method.


// Palindromo

function checkPalindrome(stringCheck){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.");
}

@sandrabosk
Copy link
Contributor

Good start Heli. Please check the comments I left here for you. Thank you for submitting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.