QQ_随意
function fewDays(y,m,d) { var arr = [31,28,31,30,31,30,31,31,30,31,30,31]; var day = 0; if(y%4 == 0){arr[1] = 29;} if(m > 12){m=12} if(d >arr[m-1]){d=arr[m-1]} for(let i = 0;i<m-1;i++){ day += arr[i]; } return day+d}console.log(fewDays(2000,4,8))console.log(fewDays(2001,5,9))console.log(fewDays(2002,6,10))console.log(fewDays(2003,7,11))