I expect 31 because this month October has 31 days, which part of my code is wrong here?
function lastDayOfMonth(given_month) {
var d = new Date();
d.setDate(0);
d.setMonth(given_month);
return d.toISOString();
}
console.log(lastDayOfMonth(given_month))
2016-10-30T13:16:14.227Z