Let's put it this way, first of all, make one thing clear.
(function(){
//code
})();
this is used to create closures, regardless of this.
then look directly inside.
Function is the prototype of all javascript functions, and you can create a function through the
Function (args) method.
in the first example, what is passed to the Function function is console.log (call)
in the closure, call = "23", console.log is executed immediately, so the result is actually
Function (undefined) (),
.
For the second example, take a look at MDN,
MDN that makes it clear that variables within the
closure will not be referenced, so although a function has been successfully created here
anonymous() {
console.log(call)
}
but it does not have the scope of call and will report a call is undefined error when it is executed immediately.
this question is mainly about this feature of Function