Is there a way you could improve the description to help clarify the relationship between "hidden" and "mystery2"?
Hi @knielsen0506 , great to see you're enjoying things, but explaining that would be defeating the purpose. Thanks, though, for the feedback.
@natfinn, hello, and there is still some misunderstanding. I explain some of it below.
Once I realized we were going through the function for the first time, input was still essentially 1.
input isn't 1 but is 4 due to
var hidden = mystery(4);
mystery2 is returned from
mystery, so the above line also makes
hidden refer to
multiplier ends up being 2 due to
var result = hidden(2) so
multiplier is 2*4 or 8.
secret is 5 like you said, you get 5*8 for 40.
mystery2 is returned. This also made
mystery(input) = 5
mystery = 5
mystery returns a function, not a value.
mystery2 is not executed when
mystery is called, but is executed when
hidden is called, as
I'll stop here, but please rethink this, no worries as it is confusing, and ask more if needed. Cheers