Can anyone explain why the month increases by 1 if its value is higher than 9? See the code snippet below:
var dd = new Date();
dd.setFullYear(2017);
dd.setMonth(7);
console.log("Month(Expected: 7, Received: " + dd.getMonth() + ")");
dd.setMonth(10);
console.log("Month(Expected: 10, Received: " + dd.getMonth() + ")");
You can check out the code on Fiddler here - https://jsfiddle.net/vzmtp3ua/