First, here's a reference to Function.prototype.call().
Basically, the first parameter in call()
is the this
object you desire to use in the called function.
The called function in this case is f1
, by the code: get_encrypted(f1)
.
So get_encrypted
gets the function f1
as a parameter, and then calls f1
, with this
as null
(when null
is passed as first parameter). Now f1
can use this
in its code, but in this case it would not be worthwhile as this
would be null
. f1
also get 'zzoon'
as second parameter for input
, but it ignores input
.
When get_encrypted
gets called, by the code get_encrypted(f1)();
, it returns the result (of a function that returns the result) of the function f1
, where f1
used or might have used null
as this
. This result is 1
.