Answer the question
In order to leave comments, you need to log in
Is it bad to declare variables at the beginning of the code?
I'm relatively new to programming (learning js). And I've got into the habit that when I'm practicing, doing some little To-Do web applications, I declare variables at the beginning of the code. But now I read that this is just a terrible habit. Do you think this is so?
Answer the question
In order to leave comments, you need to log in
For JS, it's quite normal. This is not a good practice for statically typed languages, but in JS it is quite normal.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question