📜  从日期获取日期名称 javascript 代码示例

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

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