Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

range in javascript


function range(start, end, interval = 0) {
        let arr = [];
        interval = interval > 0 ? interval-1 : 0
        for (let i = start; i < end; i++) {
             arr.push(i)
             i+=interval;
        }
        return arr
    }
// example range(0 , 100 , 5)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #range #javascript
ADD COMMENT
Topic
Name
2+7 =