For Range
Simplified syntax for a for loop.
Install
npm install for-range
Usage
const forRange = ; ; // Native JS equaiventfor let i = 2; i <= 10; i += 2 if i === 4 continue; if i === 8 break; console;
API
forRange(options, callback)
options
Type: object
min
Type: number
Default: 0
The number to start the for loop at.
max
Type: number
The number to end the for loop at.
step
Type: number
Default: 1
The amount to add to the number each iteration
callback
Type: function
The callback to trigger for each iteration.