Can somebody give me answer to the following two questions:
1) Why isn't it possible to declare variables in methods like an attribute in the comprehensive class?
What I want: private foo: string (compiler error)
What I have to do: var foo: string (no compiler error)
2) When do I declare a variable as an attribute of the class and when do I declare a variable only in the method? I'm not sure if the Java knowledge fits in this case. Spontaniously I would say it depends on the scope of the variable (if it is needed f.e. in two or more methods -> attribute of class OR otherwise -> variable of a method).
Thank you!