var is scoped to the nearest function block, whereas let is scoped to the nearest enclosing block.
Let's assume you have a function, and inside that function there's a for-loop. If you define and declare the iterator using var you could access it outside the function:
function foo() { for(var i = 0; i <= 5; i++) { console.log(i); } // i is 6 console.log(i); }
If you use let instead, i will be scoped only to the nearest enclosing block which is the for-loop:
function foo() { for(let i = 0; i <= 5; i++) { console.log(i); } // i is undefined console.log(i); }
But as a general rule, I almost never use var over let at least when I am using ES2015. That said, I cannot really think of a case where var would make sense and let not. Also, if you need to re-assign a variable, go with let and if the variable is never re-assigned use const.
Keep in mind tho that const does only mean immutabilty for primitive values and not for objects, meaning that you can still change property on an object even though you used const. It only guards from re-assigning the variable.
Personally, in most cases, I use const.
var,letandconstin JavaScript.var,letandconst. To see the differences you need to use them in larger functions.