Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

fatorial recursivo em javascript

/* 
function fatorial(numero) {
	if(numero<=1) {
    	return 1
    } else {
    	return numero * fatorial(numero - 1)
    }
}
*/
f = (n) => n <= 1 ? 1 : n * f(n-1)
 
PREVIOUS NEXT
Tagged: #fatorial #recursivo #em #javascript
ADD COMMENT
Topic
Name
5+4 =