If you want to say it's inconsistency - you need to ask the creator of specification of language. According to this page JavaScript
is based on ECMAScript
(EDIT: see @MichaelGeary comment).
And when you read from page 165 here, you will see that all is working exactly as it's designed.
For you it can be inconsistency. For me it's rather a feature - 0-based values let you access Array
straight away without doing calculations (see @Christopher's answer). In case of day of month you can't really access any Array
. It will be weird to have Array
of names of days of the month... like this:
var namesOfDays = [
"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", // and again at least 4 times ...
"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday",
"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday",
"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday",
"Sunday", "Monday", "Tuesday"
]