My problem is understanding the purpose of the var in a for in loop as they both seem to work fine. For instance,
for(i in array) {
console.log(i);
}
or
for (var i in array) {
console.log(i)
}
Both produces the same result
So I am trying to understand the difference.
Thanks for the clarification.