Two Ways to Check for Palindromes in JavaScript
Sonya Moisset
85419

Thank you so much for doing these in-depth solution articles. It has helped me greatly so far on my journey to learning JS. 
I just have two quick questions on the FOR loop example. Shouldn’t this line

var len = str.length; // var len = “A man, a plan, a canal. Panama”.length = 30

Be:

var len = str.length; // var len = “amanaplanacanalpanama”.length = 21

And, for the len variable in the IF statement should be 30 instead of 15, since it was never really declared var len/2.

if(str[i] !== str[len - 1 - i]) => if(str[0] !== str[30 - 1 - 0])
One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.