Advertisement
728x90
It is recommended to keep all declarations at the top of each script or function. The benefits of doing this are,
1. Gives cleaner code
2. It provides a single place to look for local variables
3. Easy to avoid unwanted global variables
4. It reduces the possibility of unwanted re-declarations
Advertisement
Responsive Ad
🎯 Practice NowRelated Challenge
JavaScript Coding Exercise 61
Test your knowledge with this interactive coding challenge.
Start CodingAdvertisement
728x90
146of476