Tell us what’s happening:
Describe your issue in detail here.
I dont understand why the text case “1 eye for of 1 eye.” should return false . I guess it is a palindrome . I passed all the other text cases except this . Can someone help me where I was wrong.
**Your code so far**
function palindrome(str) {
var final_string = "";
var final_before = "";
var a = []
var alpha = "abcdefghijklmnopqrstuvwxyz"
var alpha_cap = alpha.toUpperCase();
var f = []
for(var i in alpha){
a.push(alpha[i]);
}
for(var i in alpha_cap){
a.push(alpha_cap[i]);
}
for(var j in str){
if(a.includes(str[j])){
f.push(str[j])
}
}
var z = f.length;
for(var i=z-1;i>=0;i--){
final_string += f[i]
}
for(var i=0;i<z;i++){
final_before += f[i]
}
final_string = final_string.toLowerCase()
final_before = final_before.toLowerCase()
if(final_before==final_string){
return true;
}
else{
return false;
}
}
palindrome("1 eye for of 1 eye.");
**Your browser information:**
Challenge: Palindrome Checker
Link to the challenge: