Skip to content

Commit f6f5ebd

Browse files
authored
Create 1185-day-of-the-week.js
1 parent 24cc3b1 commit f6f5ebd

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

1185-day-of-the-week.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* @param {number} day
3+
* @param {number} month
4+
* @param {number} year
5+
* @return {string}
6+
*/
7+
const dayOfTheWeek = function(day, month, year) {
8+
const weekdays = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
9+
const date = new Date(year,month-1,day).getDay();
10+
return weekdays[date];
11+
};

0 commit comments

Comments
 (0)