title: What do these lines of code do?
body: <p>I'm new to programming and I'm trying to program a to-do list in Javascript and am experimenting with JQuery. I found a strikethrough animation online that I wanted to implement into the list but I am not quite sure what these two lines of code do and was wondering if someone could elaborate for me so I can better understand? The strikethrough function is as follows: </p>
  
  <pre><code>//var _Text sets the _Text to the individual list item
  var _text = document.getElementById("item_" + cbId); 
  $(document).ready(function() {
  _text = $(itemText).text();
  StrikeThrough(0);
  });
  //Strikethrough animation function
  function StrikeThrough(index) {
      if (index &gt;= _text.length)
          return false;
      var sToStrike = _text.substr(0, index + 1);
      var sAfter = (index &lt; (_text.length - 1)) ? _text.substr(index + 1, 
  _text.length - index) : "";
      $(itemText).html("&lt;strike&gt;" + sToStrike + "&lt;/strike&gt;" + sAfter);
      window.setTimeout(function() {
          StrikeThrough(index + 1);
      }, 100);
  </code></pre>
  
  <p>The two lines that I'm confused about are: </p>
  
  <pre><code>var sToStrike = _text.substr(0, index + 1);
  var sAfter = (index &lt; (_text.length - 1)) ? _text.substr(index + 1, _text.length - index) : "";
  </code></pre>
  
  <p>What I am specifically confused about is what these variables are being set to exactly</p>