Question · JavaScript and TypeScript course · Module 5: Advanced JavaScript

Months in the Date Object

What is the important gotcha when working with months in the Date object?

Answer options

  • The Date object does not support months
  • Months are numbered from 0 (January = 0, December = 11)
  • Months are numbered from 1 (January = 1)
  • Months only accept text names (e.g., 'January')

You can check the correct answer by solving this task in the CodeWorlds game.