title: Split a dynamic range into equal parts using js
body: <p>So the problem I'm tackling involves getting a dynamic range and splitting it into 6 parts. </p>
  
  <p>For example a range can start from 6.1 and end at 93.6. Or as simple as 6-24.</p>
  
  <p>At the end, what i am trying to do is to just get 6 different points in that range. If it's 1-24, that would be 4,8,12,16,20,24.</p>
  
  <p>Here is an approach that I am using with not quite accurate results:</p>
  
  <pre><code>const range = {start: '', end: ''};
  const offset = Math.ceil(range.end / 6);
  
  const markers = []
  for(let i = offset; i &lt;= range.end; i++){
    if(range.end % i == 0){
      markers.push(i)
    }
  }
  console.log(markers);
  </code></pre>