📌  相关文章
📜  获取当天的名称 javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:49.302000             🧑  作者: Mango

代码示例3
const dayIndex = new Date().getDay();
const getDayName = (dayIndex) =>{
    const days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
    return days[dayIndex];
}
const dayName = getDayName(dayIndex)