how to call same function inside this function

Solutions on MaxInterview for how to call same function inside this function by the best coders in the world

showing results for - "how to call same function inside this function"
Aymen
14 Jun 2019
1let math = {
2  'factit': function factorial(n) {
3    console.log(n)
4    if (n <= 1) {
5      return 1;
6    }
7    return n * factorial(n - 1);
8  }
9};
10
11math.factit(3) //3;2;1;
12