Write a program to print first 50 natural numbers using recursion.
The following code will print the first 50 natural numbers using recursion:
const printNumber = (num) => { if (num < 1) { return 1; } printNumber(num -1); console.log(num); return num; }; printNumber(5)