Wednesday, September 16, 2026
Latest:
  • Präsentation für b1
  • Verb “werden” Konjugation
  • In German, verb sein (to be) Konjunktion
  • Wichtige wörter für B1 prüfung
  • What are the main differences between ApplicationContext and BeanFactory?
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

JavaScript arrow function related interview questions

March 18, 2019 beroza

What is useRef in React? What are the use cases of useRef?

August 14, 2021 beroza

How to get URL query parameter value from query string in ReactJS?

February 24, 2020 beroza

Can’t access mysql from command line Mac OS

August 27, 2019 beroza

Difference between a node module and a package in Node.js?

January 4, 2022 beroza

Babel vs Webpack: What are the differences?

August 27, 2021 beroza

Traverse array of objects recursively in JavaScript

February 13, 2022 beroza

How to resize SVG type image?

May 30, 2021 beroza

How to delete an array element in JavaScript?

November 1, 2019 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.