Check for Palindromes(trying to come up with my own solution)

Tell us what’s happening:
How do I test the string to check the palindrome? so far I have removed the non alpha numeric digits.
i’ve tried if/else statements but they do not seem to work(or I havent figured it out). Any ideas? im trying to come up with my own solution. ive looked at other solutions to help form my own(dont know if thats a great idea or not).

Your code so far

function palindrome(str) {
  // Good luck!
//   first 3 variables set up lowercase, removal of non alpha nums, and concatenation of low + alpha in var con
  var alpha = str.replace(/[\W_]/g,'');
  var low = alpha.toLowerCase();
  var con = low.concat(alpha);
//   splitting reversing and joining
  var splitting = str.split('').reverse('').join('');
//   concatenation of var splitting and var con
  var con_2 = splitting.concat(con);
  return str;
}



palindrome("eye");

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36.

Link to the challenge:

You’re almost there. You need to compare a variable that has been stripped of symbols and lowercased (in your case its ‘low’ variable) with a variable that has been through the same process but with the string reversed. var splitting = low.split('').reverse('').join('').

Then you compare the low variable with the splitting variable (by returning it).

BRO! thank you so much. I still struggled a bit but I eventually got it thanks to you! here’s what I entered.

function palindrome(str) {
// Good luck!
// first 3 variables set up lowercase, removal of non alpha nums, and concatenation of low + alpha in var con
var alpha = str.replace(/[\W_]/g,’’);
var low = alpha.toLowerCase();
var con = low.concat(alpha);
// splitting reversing and joining
var splitting = low.split(’’).reverse(’’).join(’’);
var compare = low === splitting;

return compare;
}

palindrome(“eye”);

probably not the prettiest code but it got the job done. Thanks again!