Skip to content

Instantly share code, notes, and snippets.

@raullucero
Last active July 21, 2017 22:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raullucero/2a4ab5a781a252a376622d68f29a8010 to your computer and use it in GitHub Desktop.
Save raullucero/2a4ab5a781a252a376622d68f29a8010 to your computer and use it in GitHub Desktop.
// PROBLEMA: Checar si una palabra es palindroma o no
// racecar
// car
// dog
function isPalindrome(word) {
return word === word.split('').reverse().join();
}
//que pasa cuando tienes ' racecar'
function isPalindrome(word) {
return word.trim() === word.trim().split('').reverse().join()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment