How can it pass the value inside the block?

we know block of thise no pass any value without use return but why ?

//  Scope
let UserThinkMask=76;
function finalMask(){
    userThinkMask=82;
    final=userThinkMask;
    return final;
}
console.log(finalMask());
console.log(userThinkMask);

There is no value passed in to the finalMask() function as an argument or parameter.
But, the finalMask function changes the value of userThinkMask (to 82), which can be done without the function having a parameter.
Notice that userThinkMask was declared before the finalMask function.

The function is “called” on the line console.log(finalMask());
That is when the function actually runs.

You need to have return in the function if you want to have function to give you a number [or another kind of value] when it is “called” (after changing the value of userThinkMask in this case).

let userThinkMask=76; function finalMask(){ userThinkMask=82; final=userThinkMask; return final; } //console.log(userThinkMask); console.log(finalMask()); console.log(userThinkMask);

I also changed the first UserThinkMask to userThinkMask