What this snippet does
Months are 0-indexed in JavaScript Date — January is 0, December is 11 — always add 1 when displaying.
Expected output
(current year) (current month 1-12) (current day) (day of week 0-6) (ISO string) (locale date string)
Why practise typing this
Typing date code builds muscle memory for the symbols and indentation JavaScript uses most, which prose-based typing tests never cover. DevType measures your words per minute and accuracy on this snippet and tracks the individual characters you mistype, so later lessons can target them.
More JavaScript practice
- date differenceDate · intermediate
- date formatDate · intermediate
- let vs constVariables · beginner
- const configVariables · beginner
- const mutationVariables · beginner
- var hoistingVariables · beginner