← Back to challenges

Friday the 13th

JavaScriptHarddateslanguage_fundamentalsvalidation

Instructions

Given the month and year as numbers, return whether that month contains a Friday 13th.

Examples

hasFriday13(3, 2020) ➞ true

hasFriday13(10, 2017) ➞ true

hasFriday13(1, 1985) ➞ false

Notes

January will be given as 1, February as 2, etc ...

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Remove Surrounding Duplicate Items