JavaScript, Javascript Tips, Interview Questions, Datastrucutre, Javascript Interview.
i<=inputNum; i++) { result *= i; } return result; } console.log(getFactorial(5)); 6. Write a program to check whether a number is prime or not? Prime numbers: those numbers that are divisible by themselves and only by 1. const isPrime = (inputNum) => { let result = true; for(let i=2; i<inputNum;