Saturday, May 16, 2026
Latest:
  • In German, verb sein (to be) Konjunktion
  • Wichtige wörter für B1 prüfung
  • What are the main differences between ApplicationContext and BeanFactory?
  • German B1 Word list
  • How does Lazy annotation work in Spring?
Upokary

Upokary

Quality information

  • Health
  • Life
  • Fashion
  • Food
  • Code
  • English
  • বাংলা
Technology 

Write a program to print first 50 natural numbers using recursion.

Published: November 1, 2022 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)

You May Also Like

What are the new features of Java 11?

April 22, 2019 beroza

How to set default value for items of List in Java?

May 7, 2020 beroza

Factory method design pattern JavaScript

April 24, 2022 beroza

Reasons of timeout when trying to connect EC2 instance.

January 13, 2020 beroza

How Spring framework resolves circular dependencies?

October 30, 2025 beroza

ReferenceError: localStorage is not defined

April 10, 2021 beroza

Failed form propType: You provided a `value` prop to a form field without an `onChange` handler

September 2, 2019 beroza

How to specify type in object destructuring?

April 28, 2022 beroza

Security best practices for React application

June 13, 2022 beroza

Why Upokary?

Upokary.com is a useful application in everyday life. It provides very handy information regarding every aspect of life. Each and every tip of upokary.com is meant to make life better.

Upokary tools

  • Youtube thumbnail
  • Youtube video downloader

Useful Links

  • Handy code
  • Technology
  • People
  • Programming
  • Quote
  • Travel
  • WordPress
  • IELTS
  • Kids

Pages

  • Sitemap
  • Privacy policy
  • About us
  • Contact us

Support

For any kind of query or question please drop a message in the following email: upokary@gmail.com
Copyright © 2026 Upokary. All rights reserved.