← Back to challenges

Chinese Zodiac

JavaScriptHardconditionsarrayslanguage_fundamentals

Instructions

Create a function that takes a year as an argument and returns the corresponding Chinese zodiac.

Examples

chineseZodiac(2021) ➞ "Ox"

chineseZodiac(2020) ➞ "Rat"

chineseZodiac(1933) ➞ "Rooster"
javascript
Loading editor…
⌘ ↡ to run
Walks through the solution with reasoning and edge cases.
Next: Primitive Darts Game β†’