Q:

the name of function return anonymous when I define a function with new Function

I was trying to define a function with constructor Function as below, but why the name of the function return anonymous?
let sayHi = new Function('alert("Hello")');
//this will return anonymous
sayHi.name

A:

This happens because you are creating anonymouse function.
Named functions are initialized with:
function sayHi() {
  alert('Hello');
};

sayHi.name // sayHi

