re: How to create range in Javascript VIEW POST

FULL DISCUSSION
 

Thanks for this article. I find your first answer to be the most intuitive, and it works great for my situation.

function loopASequenceAgain(start, end) {
  // create a loop which loops from start to end
  var ans = [];
  for (let i = start; i <= end; i++) {
  // log current value to console
      console.log(i); 
      ans.push(i);
  }
  return ans;
}
code of conduct - report abuse