Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript create an array of range between two numbers

function range(start, end) {
const range = [...Array(max - min + 1).keys()].map(i => i + min);
var result = range(9, 18); // [9, 10, 11, 12, 13, 14, 15, 16, 17, 18]
console.log(result);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #create #array #range #numbers
ADD COMMENT
Topic
Name
3+4 =