Skip to content

Commit 8106fa6

Browse files
authored
Update 1118-number-of-days-in-a-month.js
1 parent cc31fbd commit 8106fa6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

1118-number-of-days-in-a-month.js

+6
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ function numberOfDays(Y, M) {
4343

4444
// another
4545

46+
const numberOfDays = function(Y, M) {
47+
return new Date(Y,M,0).getDate();
48+
};
49+
50+
// another
51+
4652
/**
4753
* @param {number} Y
4854
* @param {number} M

0 commit comments

Comments
 (0)