1var days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
2var d = new Date(dateString);
3var dayName = days[d.getDay()];
4
1var today = new Date();
2
3console.log(today.getDay()); // sunday = 0, monday = 1, etc..
1const dayIndex = new Date().getDay();
2const getDayName = (dayIndex) =>{
3 const days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
4 return days[dayIndex];
5}
6const dayName = getDayName(dayIndex)