← Back to challenges

Unlucky Years

JavaScriptHarddateslanguage_fundamentals

Instructions

Create a function which returns how many Friday 13ths there are in a given year.

Examples

howUnlucky(2020) ➞ 2

howUnlucky(2026) ➞ 3

howUnlucky(2016) ➞ 1

Notes

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.