Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Factorial multiplication in javascript

function factorial(n) {
    if (n == 1) {
        return 1;
    }
    return n * factorial(n - 1);
}
console.log(factorial(6));
//Output: 720
Comment

PREVIOUS NEXT
Code Example
Javascript :: alphabet as array javascript 
Javascript :: window onscroll position fixed position in jquery 
Javascript :: vanilla javascript add class 
Javascript :: remove element from array in js 
Javascript :: Javascript how to compare three numbers 
Javascript :: array to excel javascript 
Javascript :: sort string 2d array in javascript 
Javascript :: TypeError: this.authenticate is not a function 
Javascript :: js string to regex 
Javascript :: cube root of a number in js 
Javascript :: react not getting img by src 
Javascript :: lodash pluck items 
Javascript :: safeareaview not working on android react native 
Javascript :: genius api 
Javascript :: get array index by key value js 
Javascript :: jquery div element find and remove 
Javascript :: react forwardref 
Javascript :: js get random hex color 
Javascript :: jquery selector exists 
Javascript :: how to call web api with the useeffect hook in react 
Javascript :: for element in string js 
Javascript :: how to get items in dynamodb nodejs 
Javascript :: button disabled javascript 
Javascript :: zoho smtp mail nodejs 
Javascript :: js merge 2 lists 
Javascript :: react material ui classname 
Javascript :: jsx render array 
Javascript :: set dropdown in jquery 
Javascript :: shuffle array javascript 
Javascript :: store console.timeEnd in variable js 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =