text: Program for factorial of a number | JavaScript program to find factorial of given number ; single line to find factorial ; Driver Code
code: function factorial ( n ) { return ( n == 1 n == 0 ) ? 1 : n * factorial ( n - 1 ) ; } var num = 5 ; document . write ( " " + num + " " + factorial ( num ) ) ;