Hey guys and girls
I’m working my way through a Javascript book and there’s a section in there that I’m not sure about. Below is a pen of the code from that section.
http://codepen.io/porgeet/pen/JRPAqO
It looks like a function is accessing a local variable from another function.
The var in question is obj. I think the reason the code works is because the uk() and eu() functions are being called within the init() function? It doesn’t matter that the function is created outside of init()?
Is my understanding of that correct?
Many thanks to anyone who helps
porgeet