Why the dates (month) isnt displaying correctly in the localhost?


For example, if I specified '03' in the following code, it would appear to be April? It's as if every single one of my month's have been increased by one. Anyone else notice this? It's just been bothering me a lot.
$scope.products = [
name: 'The Book of Trees',
price: 19,
pubdate: new Date('2014', '03', '08'),
cover: 'img/the-book-of-trees.jpg',
likes: 0,
dislikes: 0



I'd prefer starting from 1 too as months are associated with numbers starting from 1, unlike for example week-days.

Note that your numbers are coerced into number types (won't be treated as strings)


I think his question was:
Why is it if you use

var aDate = new Date('2014', '03', '08');
console.log( aDate );
var bDate = new Date(2014,3,8);
console.log( bDate );

you get the output:

Mon, 07 Apr 2014 22:00:00 GMT
Mon, 07 Apr 2014 22:00:00 GMT

I cannot explain this.......


The arguments are explained in MDN's doc for Date