title: Does JavaScript have a method that returns an array of numbers based on start, stop and desired number of return values?
body: <p>I'm looking for something similar to <a href="https://docs.scipy.org/doc/numpy/reference/generated/numpy.linspace.html" rel="nofollow noreferrer">numpy.linspace</a> to generate an array of numbers based on a starting value, an ending value and the desired number of values in the array.</p>
  <p>Example:</p>
  <pre><code>start=2.0, end=3.0, num=5
  result = [2.0,  2.25,  2.5 ,  2.75,  3.0]
  </code></pre>
  <p>I've come across <a href="https://stackoverflow.com/questions/3895478/does-javascript-have-a-method-like-range-to-generate-an-array-based-on-suppl">this</a>, but it separates the range based on the steps between.</p>
  <p>Does JavaScript have a built-in method to accomplish this?</p>