js 获得今天星期

var currentWeek = "周" + "日一二三四五六".charAt(new Date().getDay());

console.log(currentWeek);

 

currentWeek就是今天的星期

posted @ 2022-04-26 16:11  烂笔头~  Views(402)  Comments(0Edit  收藏  举报