Skip to content

MIA Heli - #72

Closed
Helieber wants to merge 2 commits into
ironhack-labs:masterfrom
Helieber:master
Closed

MIA Heli#72
Helieber wants to merge 2 commits into
ironhack-labs:masterfrom
Helieber:master

Conversation

@Helieber

@Helieber Helieber commented Feb 1, 2018

Copy link
Copy Markdown

Made some changes!

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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