Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to write a factorial function in javascript

function factorial(num){
	return num === 1 ? 1 : num * factorial(num - 1) 
}
Source by 1loc.dev #
 
PREVIOUS NEXT
Tagged: #write #factorial #function #javascript
ADD COMMENT
Topic
Name
4+9 =