Skip to content

Latest commit

 

History

History
32 lines (27 loc) · 590 Bytes

README.md

File metadata and controls

32 lines (27 loc) · 590 Bytes

Scope;

Snippet 1

(function test() { test = 123; console.log( test );}())

What it's logged when Snippet 1 is executed?

function test() { test = 123; console.log( test );}()
__match_answer_and_solution__


Why?

When the code tries to modify test value inside the function it doesn't works because the precedence of the declaration of the function that test reference remains unchanged, then the code that is executed is console.log logs the function body in the console.
__match_answer_and_solution__