Bug Report
🔎 Search Terms
date constructor month
🕗 Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about naming conventions
⏯ Playground Link
Playground link with relevant code
💻 Code
// this is May 2022
new Date(2022, 4)
🙁 Actual behavior

The date constructor documentation gives no indication that the month parameter is zero index based (January is month 0, February is month 1). This can cause off-by-one error bugs that are hard to detect.
🙂 Expected behavior
I expected the documentation to be clear about the type of value expected in the constructor. For example:
Bug Report
🔎 Search Terms
date constructor month
🕗 Version & Regression Information
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
The date constructor documentation gives no indication that the
monthparameter is zero index based (January is month 0, February is month 1). This can cause off-by-one error bugs that are hard to detect.🙂 Expected behavior
I expected the documentation to be clear about the type of value expected in the constructor. For example:
monthparameter tomonthIndex(MDN also usesmonthIndexhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date#syntax)