如何通过最小化语句数来简化数组的以下编码:

var weekdays = new Array();
weekdays[0]= "Sun";
weekdays[1]= "Mon";
weekdays[2]= "Tue";
weekdays[3]= "Wed";
weekdays[4]= "Thu";
weekdays[5]= "Fri";
weekdays[6]= "Sat";

最佳答案

var weekdays = ["Sun","Mon",Tue","Wed","Thu","Fri","Sat"];

10-01 17:42