title: Javascript difference between two words
body: <p>How do you detect the difference between two similar words?</p>
  
  <p>For example:</p>
  
  <ul>
  <li><code>word</code> compared to <code>word,</code> gives <code>,</code> as a variable</li>
  <li><code>this</code> compared to <code>.this</code> gives <code>.</code> as a variable</li>
  <li><code>info</code> compared to <code>:info,</code> gives <code>:</code> and <code>,</code> as a variable</li>
  </ul>
  
  <p>In this case we always know which word is the longer one. And the actual word is always the same for the comparison. It's just that the longer one maybe has some extra characters.</p>
  
  <p>I need to do this using javascript only.</p>