title: repeating animate code with jquery in better way
body: <p>I'm trying to make simple animation that 
  line length changing repeatedly.</p>
  
  <p>and, here is my code</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>    $(document).ready(function(){
          var redline = $('.redline');
          setInterval(redmove,100)
      })
      function redmove(){
          var redline = $('.redline');
          redline.animate({'width':'500px'},2000)
          .animate({'width':'20px'},2000)
      }</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>    .redline{
      background: red;
      height: 10px;
      width: 20px;
      }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div class="redline"&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>my code runs well with no problem, but, I think there must be a better code(maybe more efficient..etc)</p>
  
  <p><strong>So, here is the question</strong></p>
  
  <p>1.If this code is not good, why?
  (in perspective of something like efficiency...etc)</p>
  
  <p>2.I want to know better code in this situation.</p>
  
  <p>thanks!
  HAPPY NEW YEAR!</p>