Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Range of numbers in javascript

function range(start, end) {
    if(start === end) return [start];
    return [start, ...range(start + 1, end)];
}
Source by dev.to #
 
PREVIOUS NEXT
Tagged: #Range #numbers #javascript
ADD COMMENT
Topic
Name
5+3 =