hint [4/8]
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]
hint [5/8]
You may lowercase the string using String.prototype.toLowerCase
.
type
hint
for next hint :pencil: [Contribute at the FCC Wiki]
hint [6/8]
Solution ahead!
type
hint
for next hint :pencil: [Contribute at the FCC Wiki]
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
@Stackclash The \W
matches any non-alphanumeric (and also non-underscore character).
Edit your thinking
"match any character that is non-alphanumeric (and underscore) character" also "matches whitespace character". So you don't have to write
\s
.
But you need to match the underscore character, so include the underscore.
Hence, the regex becomes /\W|_/g
:star: 565 | @abhisekp | http://www.freecodecamp.com/abhisekp
hint [1/8]
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]
hint [2/8]
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]
hint [3/8]
You may use regular expressions (RegExp
) to remove unwanted characters from the string.
type
hint
for next hint :pencil: [Contribute at the FCC Wiki]
hint [1/8]
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]
hint [2/8]
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]
hint [3/8]
You may use regular expressions (RegExp
) to remove unwanted characters from the string.
type
hint
for next hint :pencil: [Contribute at the FCC Wiki]
hint [1/8]
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]
hint [2/8]
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]
hint [3/8]
You may use regular expressions (RegExp
) to remove unwanted characters from the string.
type
hint
for next hint :pencil: [Contribute at the FCC Wiki]
hint [4/8]
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]
hint [5/8]
You may lowercase the string using String.prototype.toLowerCase
.
type
hint
for next hint :pencil: [Contribute at the FCC Wiki]
hint [6/8]
Solution ahead!
type
hint
for next hint :pencil: [Contribute at the FCC Wiki]