I'm wondering why we write this:
for (var i=0; i<11 ; i++){
console.log("The number is "+i)
}
Instead of just this:
for (i=0; i<11 ; i++){
console.log("The number is "+i)
}
Is the "var i" necessary? If not, why do we put it? Both code blocks return the same thing and work.