I saw this code on the site w3schools.com (JavaScript Best Practices)
// Declare at the beginning
var i;
// Use later
for (i = 0; i < 5; i++) {
I don’t understand why declaring this variable is considered good practice. It is needed only for the cycle. Why should i make it global