title: Palindrome check in Javascript
body: <p>I have the following:</p>
  
  <pre><code>function checkPalindrom(palindrom)
  {
  
      for( var i = palindrom.length; i &gt; 0; i-- )
      {
          if( palindrom[i] = palindrom.charAt(palindrom.length)-1 )
          {
              document.write('the word is palindrome.');
          }else{
              document.write('the word is not palindrome!');
          }
      }
  }
  checkPalindrom('wordthatwillbechecked');
  </code></pre>
  
  <p>What is wrong with my code? I want to check if the word is a palindrome.</p>