## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
##### Activity
Abhisek Pattnaik
@abhisekp
@razetime what's confusing you?
Raghu Ranganathan
@razetime
Go to FreeCodeCamp/Help, let's discuss there
Raghu Ranganathan
@razetime
hint
CamperBot
@camperbot

hint [1/8]

## ## :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]

Raghu Ranganathan
@razetime
hint
CamperBot
@camperbot

hint [2/8]

# 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]

Raghu Ranganathan
@razetime
hint
CamperBot
@camperbot

hint [3/8]

## Hint: 1

You may use regular expressions (RegExp) to remove unwanted characters from the string.

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

Raghu Ranganathan
@razetime
hint
CamperBot
@camperbot

hint [4/8]

## Hint: 2

You may use Array.prototype.split and Array.prototype.join methods or for loop.

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

Raghu Ranganathan
@razetime
hint
CamperBot
@camperbot

hint [5/8]

## Hint: 3

You may lowercase the string using String.prototype.toLowerCase.

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

Raghu Ranganathan
@razetime
hint
CamperBot
@camperbot

hint [6/8]

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

Raghu Ranganathan
@razetime
hint
CamperBot
@camperbot

hint [7/8]

## First

function palindrome(str) {
var normalizedStr = str.replace(/[\W_]/g, '').toLowerCase();
var reverseStr = normalizedStr.split('').reverse().join('');
return normalizedStr === reverseStr;
}

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

Raghu Ranganathan
@razetime
bonfire Find The Longest Word
CamperBot
@camperbot

## :fire:Bonfire: Find the Longest Word in a String :link:

function findLongestWord(str) {
return str.length;
}

findLongestWord('The quick brown fox jumped over the lazy dog');

Return the length of the longest word in the provided sentence.

more info:  bf details | bf links | hint

Abhisek Pattnaik
@abhisekp
@razetime slow down
@razetime what's the issue?
you can chat about bonfires here https://gitter.im/FreeCodeCamp/HelpBonfires
CamperBot
@camperbot
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Ethan Leyden
@Darksmurf
Bonfire: Check for Palindromes
CamperBot
@camperbot

## :fire:Bonfire: Check for Palindromes :link:

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

palindrome("eye");

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

more info:  bf details | bf links | hint

### Basic Commands:

• find TOPIC find all entries about topic. ex: find js
• wiki TOPIC show contents of topic page
• thanks @username send brownie points to another user
• about @username shows info on that user
• bonfire BONFIRENAME info on a bonfire

:speech_balloon: meet CamperBot in this room!

Ethan Leyden
@Darksmurf
help
hint
CamperBot
@camperbot

hint [1/8]

## ## :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]

Ethan Leyden
@Darksmurf
hint
CamperBot
@camperbot

hint [2/8]

# 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]

Ethan Leyden
@Darksmurf
thanks @camperbot
CamperBot
@camperbot
darksmurf sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
:star: 444 | @camperbot | http://www.freecodecamp.com/camperbot
Avendable
@Avendable
hint
CamperBot
@camperbot

hint [3/8]

## Hint: 1

You may use regular expressions (RegExp) to remove unwanted characters from the string.

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

Avendable
@Avendable
hint
CamperBot
@camperbot

hint [4/8]

## Hint: 2

You may use Array.prototype.split and Array.prototype.join methods or for loop.

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

Yosafat Ariel
@yoskakomba
hint
CamperBot
@camperbot

hint [5/8]

## Hint: 3

You may lowercase the string using String.prototype.toLowerCase.

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

Yosafat Ariel
@yoskakomba
hint
CamperBot
@camperbot

hint [6/8]

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

Yosafat Ariel
@yoskakomba
hint
CamperBot
@camperbot

hint [7/8]

## First

function palindrome(str) {
var normalizedStr = str.replace(/[\W_]/g, '').toLowerCase();
var reverseStr = normalizedStr.split('').reverse().join('');
return normalizedStr === reverseStr;
}

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

Yosafat Ariel
@yoskakomba
hint
CamperBot
@camperbot

hint [8/8]

## Second

function palindrome(str) {
str = str.toLowerCase().replace(/[\W_]/g, '');
for(var i = 0, len = str.length - 1; i < len/2; i++) {
if(str[i] !== str[len-i]) {
return false;
}
}
return true;
}

# 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.

# Credits:

If you found this page useful, you can give thanks by copying and pasting this on the main chat: Thanks @Rafase282 @abhisekp

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

Yosafat Ariel
@yoskakomba
hint
CamperBot
@camperbot
These hints depend on people like you! Please add to this :point_right: Bonfire's Wiki Hints Page
Yosafat Ariel
@yoskakomba
hint
CamperBot
@camperbot

hint [1/8]

## ## :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]

Yosafat Ariel
@yoskakomba
hint