多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
[TOC] ## 一个月中的天数 ``` If (moth = 1)Then days = 31 Else If (month = 2) Then days = 28 Else If (month = 3) Then days = 31 ... ``` 使用表驱动 ``` DIm DaysPerMonth() As Interger = {31,28,31,30,31,30,31,31,30,31,30,31} days = daysPermonth(month -1) ``` ## 星期几 bad ``` const day = new Date().getDay() let day_zh; if(day === 0){ day_zh = '星期日' }else if(day === 1) { day_zh = '星期一' } ... else{ day_zh = '星期六' } ``` good ``` const week = ['星期日', '星期一',..., '星期六'] const day = new Date().getDay( const day_zh = week[day] ```