range
Generates a month sequence between two endpoints.
API Reference
Signature
Parameters
Returns
Returns an array of immutable MonthInstance values.
If the start value has a day anchor from a date-like string or native Date,
generated values preserve that anchor for explicit day-precision output.
Throws
- Throws when
stepis0. - Throws when
stepmoves away fromend.
Agent Contract
Agent Notes
- Use
.map(String)or.map((month) => month.toString())when string output is needed. - Use
.map((month) => month.toString({ precision: "day" }))only when the start value includes a day anchor and day-precision output is needed. - Be careful with large ranges because this method allocates the full array.