Recursion - 3 exemples

PHOTO EMBED

Wed Jun 02 2021 16:49:52 GMT+0000 (UTC)

Saved by @ejiwen

function countDown(num) {
  if(num === 0) {
      console.log('Finished ', num);
    } else {
      countDown(num-1);
      console.log('FINISHED ', num);
    }
}

countDown(3);

-------------------------------------------
content_copyCOPY