判断指定月份天数 //获取指定月份天数 function getDateByMon(year, month) { let d = new Date(year, month, 0); return d.getDate(); } console.log(getDateByMon(2013, 2));