ES6 introduces the concept of block scoping. Block scoping will be familiar to programmers from other languages like C, Java, or even PHP. In ES5 JavaScript, and earlier, vars are scoped to functions, and they can "see" outside their functions to the outer context.
In ES5 functions were essentially containers that could be "seen" out of, but not into.
In ES6 var still works that way, using functions as containers, but there are two new ways to declare variables: const, and let. const, and let use {, and } blocks as containers, hence "block scope".
Block scoping is most useful during loops. Consider the following: