https://www.fullstacktutorials.com/interviews/javascript-coding-questions-answers-6.html console.log(typeof undefined); undefined console.log(typeof null); Object console.log(typeof NULL); undefined console.log(typeof typeof 1); String Find Factorial let n=5; let fact=1; for(let i=1;i<=n;i++) { fact*=i; } console.log("Factorial of",n,"is",fact); Sum of given number let n=5; let sum=1; for(let i=1;i<=n;i++) { sum+=i; } console.log("Sum of",n,"digit is",sum); Reverse of given number let n= 123; let rev=0; console.log("reverse of",n); while(n!=0) { rev=rev*10+n%10; n=parseInt(n/10); } console.log("is",rev); Fibonacci Series of given number let n1=0;n2=1;n3=0; let num=10; console.log("Fibonacci Series is :\n",n1,"\n",n2); for(i=1;i<=num;i++) { n3=n1+n2; n1=n2; n2=n3; console.log(n3); } Check given number is prime number or not Prime number is a number