title: How can i go through certain amount of numbers, storing the amount of steps it took to reach certain point? (Javascript)
body: <p><strong>Context:</strong>
  I'm storing the day of the week the user made the last purchase on my website. The function <code>getDay()</code> returns a number corresponding to that weeks day, beeing <code>0</code> as Sunday and <code>6</code> as Saturday. So a purchase made today, 07/14/2022, will store the number <code>4</code>, Thursday.</p>
  <p><strong>Problem:</strong>
  Knowing the date and day of the week the user made the purchase, i want it to know, base on the todays date, how many days will take to reach the weeks day, which the user made that purchase!</p>
  <p><strong>Clarifying:</strong>
  Exemple - If a user made a purchase on day of the week <code>0</code>, sunday, based on todays date, 07/14/2022, so number <code>4</code>, <strong>how many days will take to reach day <code>0</code></strong>? Adding number by number, we know will take 3 days, but how can i calculate dynamically???</p>
  <p><strong>More Examples:</strong>
  Find how many days will take to reach day <code>3</code>, todays beeing day <code>4</code>. So we need to go through day 5,6,0,1,2, so <code>5</code></p>
  <p>Find how many days will take to reach day <code>2</code>, todays beeing day <code>6</code>. So we need to go through day 0, 1 and 2, so <code>3</code></p>