Create and iterator for looping over a date period, e.g. every date between begin and end. Both begin and end will be included.
begin
end
Since this is an iterator remember evaluation is lazy and to use Array.from(..) if you need a proper array.
Array.from(..)
First date (inclusive)
Last date (inclusive)
Loop over every date between begin and end:
for (const date of range(begin, end)) { // do something with date} Copy
for (const date of range(begin, end)) { // do something with date}
Save an array with all dates between begin and end:
const dates = Array.from(range(begin, end)) Copy
const dates = Array.from(range(begin, end))
Create and iterator for looping over a date period, e.g. every date between
begin
andend
. Bothbegin
andend
will be included.Since this is an iterator remember evaluation is lazy and to use
Array.from(..)
if you need a proper array.