So I tried to do a very simple code to check if a word is a palindrome and to my surprised it worked!
Well half way. For some reason it won’t ever return false. I can’t find logically where it it’s wrong. I could use another set of eyes on it. Thank you!
Your code so far
`function palindrome(str) {
var newArray = str.split('')
var newArray2 = newArray.reverse();
if (newArray == newArray2)
// Good luck!
return true;
if (newArray !== newArray2())
return false;
}
palindrome("eye");`
**Your browser information:**
User Agent is: `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36 OPR/63.0.3368.71`.
**Link to the challenge:**
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/palindrome-checker