芜湖不芜
// Month here is 1-indexed (January is 1, February is 2, etc). This is// because we're using 0 as the day so that it returns the last day// of the last month, so you have to add 1 to the month number // so it returns the correct amount of daysfunction daysInMonth (month, year) { return new Date(year, month, 0).getDate();}// JulydaysInMonth(7,2009); // 31// FebruarydaysInMonth(2,2009); // 28daysInMonth(2,2008); // 29