DEV Community

loading...

Discussion on: Daily Challenge #40 - Counting Sheep

Collapse
savagepixie profile image
SavagePixie

Some recursivity in JavaScript

function countSheep(n) {
   while (n > 0) return countSheep(n - 1) + n + " sheep..."
}

or something like that.