Question: what is the difference between block scope and function scope?
Answer: A variable declared with var in a function scope can't be accessed outside that function scope. ... Variables declared with let inside a block scope are only accessible inside that scope, making let the ideal solution to the for loop index variable scope problem.