Skip to content

Latest commit

 

History

History
17 lines (13 loc) · 1.56 KB

File metadata and controls

17 lines (13 loc) · 1.56 KB

range easy #javascript

by Pawan Kumar @jsartisan

Take the Challenge

Implement a range function that returns an iterable object which can be used in a for...of loop. The range function should accept two arguments, from and to, and produce a sequence of numbers from from to to, inclusive.

for (let num of range(1, 4)) {
  console.log(num);
}
// Output:
// 1
// 2
// 3
// 4

Back Share your Solutions Check out Solutions