Closed mariechantale closed 2 months ago
sunny-sunday.js
function sunnySunday(date) { const daysOfWeek = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; const dayIndex = Math.floor((date.getTime() - new Date('0001-01-01').getTime()) / (24 60 60 * 1000)) % 6; return daysOfWeek[dayIndex]; }
Hello @mariechantale! Did you find any problem with this exercise? Please provide some details. Thank you!
sunny-sunday
sunny-sunday.js
function sunnySunday(date) { const daysOfWeek = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; const dayIndex = Math.floor((date.getTime() - new Date('0001-01-01').getTime()) / (24 60 60 * 1000)) % 6; return daysOfWeek[dayIndex]; }