I have a cat and a dog.
I got them at the same time as kitten/puppy. That was humanYears years ago.
Return their respective ages now as [humanYears,catYears,dogYears]
humanYears >= 1
humanYears are whole numbers only
15 cat years for first year
+9 cat years for second year
+4 cat years for each year after that
15 dog years for first year
+9 dog years for second year
+5 dog years for each year after that
If you liked this Kata there is another related one here
const humanYearsCatYearsDogYears = humanYears => [
( humanYears – 1 ? 16 : 11 ) + 4 * humanYears,
( humanYears – 1 ? 14 : 10 ) + 5 * humanYears,