13
如何缩短将数字转换为月份名称的开关盒?
有没有办法在更少的行上编写此代码,但仍然易于阅读? var month = ''; switch(mm) { case '1': month = 'January'; break; case '2': month = 'February'; break; case '3': month = 'March'; break; case '4': month = 'April'; break; case '5': month = 'May'; break; case '6': month = 'June'; break; case '7': month = 'July'; break; case …