6

In Java8, we can get a stream of numbers in a range like:

IntStream.range(1, 3).forEach(System.out::println);
IntStream.rangeClosed(1, 3).forEach(System.out::println);

How can I get a array in JS like [1, 2, 3] with minimum of coding?

The question comes out when I'm solving this: LeetCode 412. Fizz Buzz

CaryNovA
  • 61
  • 2
  • 4

0 Answers0