I noticed that when declaring a variable inside a function then trying to access this variable's value from outside the function's scope, i got a RefereceError but if i called this function and then tried to access the same variable's value i can reference it, my question is why the language behaves that way?
ability to call outside of function's scope
what i thought would happen that i'd get a reference error in either ways