function getDaysInMonth(year, month) {
// 接受俩个参数 年,月
var date = new Date(year, month, 1);return new Date(date.getTime() - 864e5).getDate();
}
getDaysInMonth(2018, 2); // 28天
function getDaysInMonth(year, month) {
// 接受俩个参数 年,月
var date = new Date(year, month, 1);}
getDaysInMonth(2018, 2); // 28天