首页 > 代码库 > js取当前周几

js取当前周几

 纯javascript取当前周几

var dayNames = new Array("星期天","星期一","星期二","星期三","星期四","星期五","星期六");Stamp = new Date();console.log(dayNames[Stamp.getDay()]);

执行结果:

技术分享

js取当前周几