title: Javascript assignment multiplication operators in a loop as a Math function
body: <p>I am doing the following calculations in a loop:</p>
  
  <p><strong><a href="https://jsfiddle.net/0xLvxjar/" rel="nofollow">https://jsfiddle.net/0xLvxjar/</a></strong></p>
  
  <pre><code>var i = 0;
  var times = 200;
  var friction = 0.9925;
  var velocity = 10;
  var position = 100;
  
  for (; i &lt; times; i += 1) {
      velocity *= friction;
      position += velocity;
  }
  
  console.log(velocity) // 2.218723008169958 
  console.log(position) // 1129.722321918849
  </code></pre>
  
  <p>I would like to rewrite that as a Math function and eliminate the loop if possible.</p>
  
  <p>Looking trough the JavaScript Math object: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math" rel="nofollow">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math</a> I am not seeing something to handle this.</p>
  
  <p>Is there a better way of getting to the final result using a Math formula?</p>