September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
19
Task/Day-of-the-week/JavaScript/day-of-the-week-3.js
Normal file
19
Task/Day-of-the-week/JavaScript/day-of-the-week-3.js
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
(() => {
|
||||
'use strict';
|
||||
|
||||
// xmasIsSunday :: Integer -> Bool
|
||||
const xmasIsSunday = year => (new Date(year, 11, 25))
|
||||
.getDay() === 0;
|
||||
|
||||
// range :: Int -> Int -> [Int]
|
||||
const range = (m, n) =>
|
||||
Array.from({
|
||||
length: Math.floor(n - m) + 1
|
||||
}, (_, i) => m + i);
|
||||
|
||||
|
||||
|
||||
return range(2008, 2121)
|
||||
.filter(xmasIsSunday);
|
||||
|
||||
})();
|
||||
1
Task/Day-of-the-week/JavaScript/day-of-the-week-4.js
Normal file
1
Task/Day-of-the-week/JavaScript/day-of-the-week-4.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
[2011, 2016, 2022, 2033, 2039, 2044, 2050, 2061, 2067, 2072, 2078, 2089, 2095, 2101, 2107, 2112, 2118]
|
||||
Loading…
Add table
Add a link
Reference in a new issue