Which test cases are you failing?
1. palindrome("A man, a plan, a canal. Panama") should return true. 2. palindrome("My age is 0, 0 si ega ym.") should return true. 3. palindrome("0_0 (: /-\ :) 0-0") should return true.
These three parts, I am not able do.
Ok, what I would do is go through each test case by changing the argument in your function call, and adding a console.log statement to examine what my function is actually doing.
palindrome('A man, a plan, a canal. Panama.')
- Since we know it is currently returning
false, just before the
return falseline, add
console.log(joining). This will tell us what
joiningactually looks like. You might also want to console.log() other variables.
- Open Chrome dev tools (
ctrl + shift + I) and choose the console tab.
- Run the tests again on FCC.
- Look at the first line on the console. It should say this:
.amanaP.lanacanalpanamA(ignore the rest for now - they relate to other tests) - You should clear the console each time to make this process easier as you continue.
.amanaP.lanacanalpanamAshows us that you have not replaced
.characters, and that you have retained capital letters. Either of these could be causing your problems. So determine what the problem is based on that and fix it.
- Run the tests again - you might pass.
- If you didn’t pass, change the argument in your palindrome function call again and repeat the above process.
Thanks Done that and Solve that.
Cool! Good job