A company decides that whenever Xmas falls on a Sunday they will give their workers all extra paid holidays so that, together with any public holidays, workers will not have to work the following week (between the 25th of December and the first of January).
Task:
Write a function that takes a start year and an end year and return an array of all the years where the 25th of December will be a Sunday.
findXmasSunday
is a function.
testString: assert(typeof findXmasSunday === 'function', 'findXmasSunday
is a function.');
- text: findChristmasSunday(2000, 2100)
should return an array.
testString: assert(typeof findXmasSunday(2000, 2100) === 'object', 'findChristmasSunday(2000, 2100)
should return an array.');
- text: findChristmasSunday(2008, 2121
should return [1977, 1983, 1988, 1994, 2005, 2011, 2016]
testString: assert.deepEqual(findXmasSunday(1970, 2017), firstSolution, 'findChristmasSunday(2008, 2121
should return [1977, 1983, 1988, 1994, 2005, 2011, 2016]');
- text: findChristmasSunday(2008, 2121
should return [2011, 2016, 2022, 2033, 2039, 2044, 2050, 2061, 2067, 2072, 2078, 2089, 2095, 2101, 2107, 2112, 2118]
testString: assert.deepEqual(findXmasSunday(2008, 2121), secondSolution, 'findChristmasSunday(2008, 2121
should return [2011, 2016, 2022, 2033, 2039, 2044, 2050, 2061, 2067, 2072, 2078, 2089, 2095, 2101, 2107, 2112, 2118]');
```