Closure functions

function myfunc(arg1){
console.log(arguments[0]);
function func2(){
let a=10;
console.log(a);
}

return func2();

}

var ans = myfunc(20);
console.log(typeof ans);

in this output of type of ans is undefined …why it is not a function?
and in which line is func2() called here?

Return func2;
Instead of
Return func2();

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.