These are chat archives for camperbot/bonfire-check-for-palindromes

2nd
Sep 2015
Rafael J. Rodriguez
@Rafase282
Sep 02 2015 01:33
hint
CamperBot
@camperbot
Sep 02 2015 01:33

hint [1/12]

## :construction: After this are possible spoiler hints.

Make sure you've tried to hard to solve it yourself before proceeding. :construction:

type hint for next hint :pencil: [Contribute at the FCC Wiki]

Rafael J. Rodriguez
@Rafase282
Sep 02 2015 01:33
hint
CamperBot
@camperbot
Sep 02 2015 01:33

hint [2/12]

# Explanation:

You have to check if the string you get as an input is a palindrome and return true if it is, and false otherwise.

type hint for next hint :pencil: [Contribute at the FCC Wiki]

Rafael J. Rodriguez
@Rafase282
Sep 02 2015 01:33
hint
CamperBot
@camperbot
Sep 02 2015 01:33

hint [3/12]

Hint: 1

Make sure to turn the string to lowercase.

type hint for next hint :pencil: [Contribute at the FCC Wiki]

Rafael J. Rodriguez
@Rafase282
Sep 02 2015 01:33
hint
CamperBot
@camperbot
Sep 02 2015 01:33

hint [4/12]

Hint: 2

You will need to use split() and join()

type hint for next hint :pencil: [Contribute at the FCC Wiki]

Rafael J. Rodriguez
@Rafase282
Sep 02 2015 01:33
hint
CamperBot
@camperbot
Sep 02 2015 01:33

hint [5/12]

Hint: 3

Using regular expressions to change to lowercase will make things easier and the code simpler.

type hint for next hint :pencil: [Contribute at the FCC Wiki]

Rafael J. Rodriguez
@Rafase282
Sep 02 2015 01:33
hint
CamperBot
@camperbot
Sep 02 2015 01:33

hint [6/12]

Spoiler Alert!

687474703a2f2f7777772e796f75726472756d2e636f6d2f796f75726472756d2f696d616765732f323030372f31302f31302f7265645f7761726e696e675f7369676e5f322e676966.gif

Solution ahead!

type hint for next hint :pencil: [Contribute at the FCC Wiki]

Rafael J. Rodriguez
@Rafase282
Sep 02 2015 01:33
hint
CamperBot
@camperbot
Sep 02 2015 01:33

hint [7/12]

My code:

function palindrome(str) {
  str = str.replace(/[^a-zA-Z]/g,'').toLowerCase();
  if (str === str.split('').reverse().join('')) {
    return true;
  } else {
    return false;
  }
}

type hint for next hint :pencil: [Contribute at the FCC Wiki]

Rafael J. Rodriguez
@Rafase282
Sep 02 2015 01:33
hint
CamperBot
@camperbot
Sep 02 2015 01:33

hint [8/12]

My Code Explanation:

We use regular expressions to replace any uppercase letter into a lowercase. Then we check if the string is the same as the reversed string using split() to split the original string by characters, then reverse and then join it back together.

type hint for next hint :pencil: [Contribute at the FCC Wiki]

Rafael J. Rodriguez
@Rafase282
Sep 02 2015 01:33
hint
CamperBot
@camperbot
Sep 02 2015 01:33

hint [9/12]

Author

@Rafase282

Submitted by Rafase282

Github | FreeCodeCamp | CodePen | LinkedIn | Blog/Site | My Wiki

type hint for next hint :pencil: [Contribute at the FCC Wiki]

Rafael J. Rodriguez
@Rafase282
Sep 02 2015 01:34
hint
CamperBot
@camperbot
Sep 02 2015 01:34

hint [10/12]

Details

  • Difficulty: 1/5

Return true if the given string is a palindrome. Otherwise, return false.

A palindrome is a word or sentence that's spelled the same way both forward and backward, ignoring punctuation, case, and spacing.

You'll need to remove punctuation and turn everything lower case in order to check for palindromes.

We'll pass strings with varying formats, such as "racecar", "RaceCar", and "race CAR" among others.

Remember to use Read-Search-Ask if you get stuck. Try to pair program. Write your own code.

type hint for next hint :pencil: [Contribute at the FCC Wiki]

Rafael J. Rodriguez
@Rafase282
Sep 02 2015 01:34
hint
CamperBot
@camperbot
Sep 02 2015 01:34

hint [11/12]

Useful Links

type hint for next hint :pencil: [Contribute at the FCC Wiki]

Rafael J. Rodriguez
@Rafase282
Sep 02 2015 01:34
hint
CamperBot
@camperbot
Sep 02 2015 01:34

hint [12/12]

Problem Script:

function palindrome(str) {
  // Good luck!
  return true;
}
palindrome("eye");

type hint for next hint :pencil: [Contribute at the FCC Wiki]

Rafael J. Rodriguez
@Rafase282
Sep 02 2015 01:34
hint
CamperBot
@camperbot
Sep 02 2015 01:34
These hints depend on people like you! Please add to this :point_right: Bonfire's Wiki Hints Page
Rafael J. Rodriguez
@Rafase282
Sep 02 2015 01:34
there information is there