variable declaration in javascript [migrated]
- by ShaggyInjun
I have been doing something like this for a while and I have never seen any errors. But, unfortunately, I have never been able to explain why this works.
The first line creates a variable which points to a function. The second line just adds func2 to func1 separated by a dot and defines a function.
If I add a var in front of func1.func2 then I…