title: I need an explanation on slice()
body: <p>I was completing javascript exercises and got stuck on creating a function which checks if a string is a palindrome. For your reference, <a href="http://www.w3resource.com/javascript-exercises/javascript-solution.php?q=http%3A%2F%2Fjsbin.com%2FaleDItU%2F2%2Fedit%3Fhtml%2Cjs%2Coutput&amp;r=Write%20a%20JavaScript%20function%20that%20checks%20whether%20a%20passed%20string%20is%20palindrome%20or%20not?" rel="nofollow">this</a> was the given solution.</p>
  
  <p>I understand what slice() does as a method, and I followed the function here until the point where it checks to see if the first letter matches the last.  </p>
  
  <blockquote>
    <p>if (cstr[x] != cstr.slice(-1-x)[0])</p>
  </blockquote>
  
  <p>What is going on with the parameter values of the slice method? I was expecting the parameters to slice the last letter and I presume it does but I would appreciate some help in pointing out how! </p>