How to define a recursive function, even if the name changes?

"use strict";

// 
var digui2 = digui;
// 
digui = null;

digui2(10); // 

function digui(num) {
  if (num < 2) {
    return 1;
  } else {
    return num * digui(num - 1);
  }
}

I know that arguments.callee can be used instead of function names, but the problem is that our project is in strict mode.
arguments.callee cannot be used in strict mode.
is there any other way?

Mar.04,2021

you can consider the following instead of directly declaring ~

var digui = function f(num) {
  if (num < 2) {
    return 1;
  } else {
    return num * f(num - 1);
  }
}
var digui2 = digui;
// 
digui = null;

console.log(digui2(10));
Menu