胡说叔叔
我用 JavaScript 解决了const monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];const maxDateCnt = 11;const countFiveMonts = [];const dateTime = new Date();let monthCnt = dateTime.getMonth();let monthCpy = monthCnt;for(let i = 0; i < 6; i++){ let current; if(monthCnt > maxDateCnt){ monthCnt -= 12; monthCpy = monthCnt; current = monthNames[monthCnt]; }else{ current = monthNames[monthCpy + i]; } countFiveMonts.push(current); monthCnt++;}console.log(countFiveMonts);