NODjS PROGRAMMING
2.57K subscribers
89 photos
23 files
4 links
Hello! I am @imabhi3030 and welcome to the Coding channel! Here we can learn all things related to coding and improve our skills. I am always present to help you. If you need any kind of assistance, just let me know! 😊
Download Telegram
here's an example of a TypeScript program that calculates the factorial of a given number:

function factorial(num: number): number {
if (num === 0) {
return 1;
} else {
return num * factorial(num - 1);
}
}

const number = 5 // replace with the number you want to find the factorial of
const result = factorial(number);

console.log(The factorial of ${number} is ${result});
console.log("Hello, world!");

// first js program