Skip to content

Latest commit

 

History

History
17 lines (11 loc) · 714 Bytes

README.md

File metadata and controls

17 lines (11 loc) · 714 Bytes

class Range

Build Status Coverage Status WebReflection status

An iterable Range class.

The usage is as simple as new Range(start = 0, end = Infinity, step = 1), with a .for(iterable) method.

import Range from 'class-range';

for (const i of new Range(0, 3))
  console.log(i); // 0, 1, 2

for (const c of new Range(1, 3).for('abcd'))
  console.log(c); // "b", "c"