title: mapping a range of dates to time slots with reduce
body: <p>I have a class <code>TimeSlotEntity</code> and I have a range object with dates, that's, roughly speaking, is like this:</p>
  <pre><code>const slotRange = ['15:00', '15:30', '16:00', '16:30', '17:00', '17:30', '18:00'];
  </code></pre>
  <p>In code it looks like this:</p>
  <pre><code>const range = moments.range(startEventTime, endEventTime).by('minutes', { step: 30 });
  </code></pre>
  <p>The <code>TimeSlotEntity</code> class has date setters: <code>setDateFrom(val: Moment)</code>, <code>setDateTo(val: Moment)</code>;</p>
  <p>I would like to map the range to the corresponding <code>TimeSlotEntity</code>s so that the first slot would be from 15:00 to 15:30, the second one from 15:30 to 16:00, the third one from 16:00 to 16:30 etc.</p>
  <p>How to do this with the javascript reduce function?</p>