js获取某月有多少天 var day = new Date(2018,10,0); //最后一个参数为0,意为获取2018年10月一共多少天 console.log(day.getDate()); //31