1. For loop

Variables defined by for inside the loop can also be accessed externally

var count = 10; 
for (var i = 0; i < count; i++){ 
 console.log(i); 
} 
console.log(i)
Copy the code

Screenshot below: