title: Append string to DOM in runtime and remove it after X seconds
body: <p>im trying to append some strings to a section and want each string to be removed from the DOM after x seconds. What is wrong with my code?</p>
  
  <p>for example:</p>
  
  <p>JS and HTML:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var strings= ['one', 'two', 'three'];
  var removeAfter = 0;
  for(i in strings){
    removeAfter += 5;
    $('#stringsHolder').append(strings[i]);
    setTimeout(function(){
      $("#stringsHolder").last().remove();
    }, removeAfter);  
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;section id="stringsHolder"&gt;</code></pre>
  </div>
  </div>
  </p>